it knows when the puzzle is finished