Added pause class and implemented backbutton