updated to ignore std if not present for knn