Implemented pause

it turned out very ugly, should be refactored later