templatized the T calculator