kmeans_v1 changed distribute function