fixed up editTemplate, added commenting