rearrangng source code