change generate_code