tm - added header and footer code for code generator