Calculates gcd of two number