rearrangement of code