Rearranged and commented functions.
Gave more space to between functions.