add gn, gcd function.