Added KDTree stuff