Performed general refactoring, commented existing sections