Modified generate_data routines