fixed pausebutton and some code cleaning