adding functions to buttons