cl is needed for the loop function