Working KdTree