rearrange DOM elements