Adding button layout logic.