initial commit for legacy knn code