getting logic put together to control button appearances