added data_generator routine