reorganizing with cake pattern