code_changes

Rearranged the code to make more sense.