         return bind( t1, null, t2, changes )
 
 # unification!
+unify = (expr1,expr2,changes=[]) ->
+    success = true
+    expr1 = if expr1 instanceof Tin then expr1 else parse(expr1)
+    expr2 = if expr2 instanceof Tin then expr2 else parse(expr2)
+    success = _unify(expr1.node,expr1.varlist,expr2.node,expr2.varlist,changes)
+    if success == false
+        return null
+    else
+        return [expr1,expr2]
 _unify = (n1,v1,n2,v2,changes=[]) ->
     return true if n1 == undefined and n2 == undefined
     return true if n1 == null and n2 == null

    unparse: () ->
        unboxit @node

boxit = (elem,tinlist) ->
    if elem instanceof Variable
        tinlist?[elem.name] =  new Tin( elem.name, null, null )

# utils
if typeof module == 'undefined' then window.JSUnify={}
extern=(name, o)->if typeof module == 'undefined' then window.JSUnify[name] = o else module.exports[name] = o
str=(o)->
    if typeof o == "undefined"
        return "undefined"
