Cleaning up code. Also, PEP 8 compliant