refactoring extGCD, not done