Initial implementation of knn