Remove first element of array before looping through it
Change integer depth parameter to boolean getChildren for getNodesForPath method