Removed old, commented-out code.
Added comments to better explain what is going on in the code.