Puzzle Node problems in Java