formatted the code in T2, now much more readable