the second version of template file

Should work with all types