added template count capability