distance formula added to knn