     if this.sign != other.sign
       this.minus other.neg()
     else
-      new LongInt(add(this.digits, other.digits), this.sign)
+      create(add(this.digits, other.digits), this.sign)
 
   minus: (other) ->
-    cmp = (diff, r, s) ->
-      if r and s
-        recur -> cmp(new List(r.first() - s.first(), diff), r.rest(), s.rest())
-      else if r or s
-        if r then 1 else -1
-      else
-        diff.drop_while((x) -> x == 0)?.first() or 0
-
     sub = (r, s, b = 0) ->
       if b or (r and s)
         [r_, s_] = [r or Z, s or Z]


    if this.sign != other.sign
      this.plus other.neg()
    else if (resolve cmp(null, this.digits, other.digits)) < 0
      new LongInt(sub(other.digits, this.digits), -this.sign)
    else
      new LongInt(sub(this.digits, other.digits), this.sign)

  toString: (sep = '') ->
    rev = @digits.reverse().drop_while (d) -> d == 0


## Test code

a = new LongInt(-999999999499)
b = new LongInt(501)
c = new LongInt(999999999500)

console.log "a   = #{a.toString('_')}"
console.log "b   = #{b.toString('_')}"
console.log "c   = #{c.toString('_')}"
console.log "c   = #{c.toNumber()} (as number)"
console.log "a+b = #{(a.plus b).toString('_')}"
console.log "a-b = #{(a.minus b).toString('_')}"
console.log "a-b = #{(a.minus b).toNumber()} (as number)"
console.log "a-a = #{(a.minus a).toString('_')}"
console.log "b-a = #{(b.minus a).toString('_')}"
console.log "a+c = #{(a.plus c).toString('_')}"
