rearrange solution