rearrange variable order