rearrange elements directory