Re-order

Just reorder some of the code.