Remove the T from time to make it more readable
Simplify the if statements a bit
Don't define unneeded variables