PEP8 compatible & fixed some minor errors