Updated code to make it more compliant to PEP8