Set up the UI with buttons and built some functions