Added Python3 support
Rewrapped a few lines

So this is my first attempt to port something to python3 :)