incorrect code in check_all_equal