finish the dataset generation