Inverse computation changed to EEA + little changes