Implemented control code generation