Finish writing and testing gcd