updated code to pep8 coding style