fix for assign centroids
main script