code rearrange