adds method for getting the index of a node wrt to its siblings
recursive selection of next node