Fix PEP8 issues and properly format the code