code generation implemented