added forEachNodesInRange function