updates to kmeans distance calculations