Modify check_ideal_equality and check_groebner procedures, check further when remainders are not 0