added second code generator.

added a second test code generator which works slightly differently to
the first.