code generation part