Implemen code generator (builds, but is untested)