Adds functionality to buttons