Cleaning up and Moving Functions

Deleted unnecessary variables, moved functions to a spot in the script
before they are called, re-organization of folders,