kNN implemented for exercise 6