Moved extended-euclidean-algorithm