test and implementation for iterating kmeans simulation