KnnImplementation