unification algorithm basically works