documentation for rearrange