code generation works