Updated PID calculations