modified some functions to mpz_class.