fix matrix mean
find min avg distance for identifying centroid