change kmeans in order to behave like kmedoids