Implemented pause/resume
need to dive deeper into the code