I fixed the readability of the code and fixed pylint errors.