further fixes to rearrangement