manual knn