added small code generation utility and control code for running multiple generations