cleaned up kmeans example