cleans up the global scope, implements pause functionality, starts implementing tests