add update centroid method