WIP: working knn method out of loop
WIP: use kNN inside a loop