updated kdtree indexes to use scaled distance for knn search