Implement logic behind displaying buttons