a knn implementation in ruby