Huge clean-up, adding headers, streamlining code, adding structure, adding comments