Adjusted layout to be more flexible