control loop working