rearrange things so they fit together