Rearranged the code.