Implemented Euclidean algorithms. #149