some pid improvements