Finish the unification algorithm