extend kmeans for k=2 to K-means