1st draft including data generation function