adding counts to template