add k-means method