add gcd and extended gcd