added exit button and attempted to fix bugs. Bugs still remain