Very sloppy but I think it works.
Code cleanup, a back button, and some overall fixes.