Separating out node selection algorithm