added back button, cleaned up code