Finished comments for first part of code. Gotta go to work.
Fixed an error that was driving me crazy! A function called in the main body must be placed before the main body in the code