working knn - pre-final