Adding functionality to the buttons.