splitting generate data
finished code for post 2