Hoangs code for regenrating new dataset with duplication