added templates
fixed naming issue
tidied up the template