diff --git a/6/solve.hs b/6/solve.hs
index 14656fd28a06cbf6bfa5caf4736820af6decc4b9..faf8b6d03dffb1a806348797eda30e047b4e531a 100644
--- a/6/solve.hs
+++ b/6/solve.hs
@@ -2,23 +2,13 @@
 
 type EnumeratedChar = (Int, Char)
 
-sample :: String
-sample = "mjqjpqmgbljsphdztnvjfqwrcgsmlb"
-
-sample1 :: String
-sample1 = "nppdvjthqldpwncqszvftbrmjlhg"
-
 allDifferent :: (Eq a) => [a] -> Bool
 allDifferent []     = True
 allDifferent (x:xs) = x `notElem` xs && allDifferent xs
 
-takeLeftRight :: Int -> [a] -> ([a], [a])
-takeLeftRight n = taking . splitAt n
-    where taking (left, right) = (take 4 $ reverse left, take 4 right)
-
-takeLeftRight' :: Int -> [a] -> ([a], [a])
-takeLeftRight' n = taking . splitAt n
-    where taking (left, right) = (take 14 $ reverse left, take 14 right)
+takeLeftRight :: Int -> Int -> [a] -> ([a], [a])
+takeLeftRight splitIndex takeN = taking . splitAt splitIndex
+    where taking (left, right) = (take takeN $ reverse left, take takeN right)
 
 checkForMarker :: [EnumeratedChar] -> Int
 checkForMarker l = if (length $ getString l) < 4
@@ -38,11 +28,11 @@ getString :: [(Int, Char)] -> String
 getString = snd . unzip
 
 solve1 :: String -> Int
-solve1 s = fst $ head $ filter (\(x, _) -> x > 0) $ map (\x -> evalTuple $ takeLeftRight x i) [1..(length s)-1]
+solve1 s = fst $ head $ filter (\(x, _) -> x > 0) $ map (\x -> evalTuple $ takeLeftRight x 4 i) [1..(length s)-1]
           where i = zip [1..] s
 
 solve2 :: String -> Int
-solve2 s = fst $ head $ filter (\(x, _) -> x > 0) $ map (\x -> evalTuple $ takeLeftRight' x i) [1..(length s)-1]
+solve2 s = fst $ head $ filter (\(x, _) -> x > 0) $ map (\x -> evalTuple $ takeLeftRight x 14 i) [1..(length s)-1]
           where i = zip [1..] s
 
 main :: IO ()