code: def modInv(a, m):
      
      # notice that a and m need to co-prime to each other.
      if coPrime([a, m]):
          linearCombination = extendedEuclid(a, m)
          return linearCombination[1] % m
      else:
          return 0
docs: returns the multiplicative inverse of a in modulo m as a
         positive value between zero and m-1