Modified main script to get nodes in certain range