python3 compatibility, better command line options