updated and mod to compat.py