kNN alogrithm completed