Added functionality to the buttons