Rearranged the order of the code. Enough aesthetic tweaks for now.