Adding kd-tree bounding box check