Updating centroids + stop condition