Added quit when pressing escape button

Also cleaned some things