Added functionality to buttons.