beginning of button functions