Use Euclid's algorithm rather than the binary one.