translate m position (x:xs)
  | withinBounds position' m = translate m position' xs
  | otherwise = translate m position xs
  where
    position' = move position x
translate m position (x:xs)
  | withinBounds position' m = translate m position' xs
  | otherwise = translate m position xs
  where
    position' = move position x
translate m position (x:xs)
  | withinBounds position' m = translate m position' xs
  | otherwise = translate m position xs
  where
    position' = move position x