working out the layouts