cleaned up kmeans exercise