Refactored to confirm to PEP8 standards