completed kNN classification