Working puzzle solver.