KdTree: Implementing recursion for the range() operation