Implemented the KdTree range search