rearrange  elements