pushing kmeans to be modified as a function