Added comment to centroids function