added implementation to gcd, does not currently work