add kmeans analysis
some minor changes