added unification algorithm