changing logic to control_loop since that is what these new functions do