Python3 compatible

Tested with python2.7 only, is the oldest python in my system :/ and of course with python3