Updated to proper code.

Changed everything to the way it should be. From here just branch when
you need to make a new template.