rearranging document