add gcd after snippet