temp rearrange rewrite