Added knn code