assign centroids function