Do you want me to change the code to use isPaused? I just added a state variable.