Added a pause function.