changed gen_random_output