rearrange js