modify code in order to conform to PEP8