progress on template.c