begin implementing unification algorithm