Added some funcionality to the buttons.