implement k-means (k=2)