almost done with binary gcd