Rearrange diagram