Update findtheNextNode.java