added some code to generate the template