this gives a feasible solution for very small puzzles