added a rudimentary pause function