finds greatest common divisor of two numbers