added functionality to buttons in main