modified generator functions
fixed generate_functions conflict