util/pass2.py enhanced