Update Puzzle generation logic