Fully working Python3 port.