new submodel for generating code
fixed a few errors from codegen
generated code