Cluster method update centroid not working