coppied model gen code to ModelGenerator, compiles but is not used, passes unit tests