Changed the back button to be way more flexible