add old gcd implementation