added all templates and template functions