create a method moving to next node