moved the buttons into their own function