Adding logging module and pep8 fixes