adding kmeans and distance helper