added pid control