Added node selection code