added seperate P and T update code, and computes dt from timer (untested)