implemented the pid controller