edited index and kmeans