Merged code into one .py file.
Updated code to closer align with PEP 8.