Cleaned up code to comply with PEP 8