Rearrange elements.