modified simple_generate