code rearrangments