k-mean - closest centroid working