compare2.py: code cleanups