New Knn algorithm with kdtree