find nodes helper