another version of knn.py