Code rearranged