Add knn implementation