Added weighted option to knn