decode m key position (moves:xs) =
  decode m (key ++ Matrix.getElem y x m) position' xs
  where
    position'@(x, y) = translate m position moves
decode m key position (moves:xs) =
  decode m (key ++ Matrix.getElem y x m) position' xs
  where
    position'@(x, y) = translate m position moves
decode m key position (moves:xs) =
  decode m (key ++ Matrix.getElem y x m) position' xs
  where
    position'@(x, y) = translate m position moves