solves puzzles