modified revtable.py