Updated code to be in line with PEP8