changed the puzzle method