PEP8 formatting changes, some variable renaming, and comments