beginning steps to put event handler for buttons in its own function