Fixed code to meet PEP style guides