code to make initial state for centroids