tidying up kmeans