added the templates and some of the js