kNN routine added