python3 compatibility + cleanup + pdf doc update