You can simplify; all the global variables are zeroed before setup runs, and T1 and T2 could be initialised when declared.