added PID controller code