Adding the extended euclidean algorithm to find the coefficients x and y