Added exit button

Also removed couple of unused variables