modified code to be in conformity with pep8