refactored clue
Now solves (very simple) 2D puzzles