various tweaks to knn