added function handler for clicking buttons and updating the button text on click, most of functionality is now available, will attempt to combine the two