Adapted code to be compliant with PEP8