Cleaned up imports and made the code adhere to PEP8