added k-means segmentation