Implemented Euclid's Algorithm