PEP8 error fixing and unit testing