Added pause/resume functionality (untested).