code generation corrected