Updated the behavior of the centroid