Implemented a k-means data generator