Restructered solvePuzzle iteritavely. Runs infinitely, needs debugging