added template to output as well