template values and counting