a very primitive example of knn implementation