code now uses templates
t