Python2 to Python3
Some changes to make the code PEP8 compilant