code generation part 1