python3 support.. somewhat dirty