updated knn and example