Added ability to pause and resume