improved clarity of pause_state, renamed counter to loop_counter