Put type declarations outside for loops for standards sake.

Also modified a few other things, commented out most of the function calls in the main file