Reimplemented rearrange