Changed to generate data to files, and then use files to do kmeans