run k-means function