Finds the greatest common divisor of two numbers