edited check_equivalence.py