Refactoring, recommenting

And removing extraneous code.