Fixing scope and formatting

Fixing the scope of functions (declaring them)
Fixing formatting to the statics (for our own convention)