the simplest gcd implementation i could think of