modified PID library