Finished implementing the button events