rearrange some globals.