Add Python 3 compitability

PEP8 has been applied as well.