Added set and generate function to set values and then generate the .tpl file.