Untested version of code generator