full pid control and some cleanup