Fixed createCentroids function.