Index: tol/btol/bmodel/aia.cpp
===================================================================
--- tol/btol/bmodel/aia.cpp	(revision e4cfd8b0c78d24839af0f2fed3bc2814a1e3d38e)
+++ tol/btol/bmodel/aia.cpp	(revision 75c47a9e5981f2b8150e22f07d8121e44c669e1f)
@@ -89,5 +89,8 @@
 :BObject(name), responseFunction_(rat), aia_(NIL), enabled_(BTRUE)
 {
-//Std(BText("\nCreating outlier ")+name+" = " +rat.Name());
+#ifdef TRACE_LEVEL
+  BText fun = BText("  BOutlier::BOutlier");
+#endif
+  TRACE_SHOW_TOP(fun,BText("\nCreating outlier ")+name+" = " +rat.Name());
   if(name.HasName())
   {
@@ -120,6 +123,9 @@
 //--------------------------------------------------------------------
 {
+#ifdef TRACE_LEVEL
+  BText fun = BText("  BOutlier::CalcExpand");
+#endif
   expand_[n] = responseFunction_.Numerator().Coef(n);
-//Std(BText("\n   Expand[")+n+",0]="+expand_[n].Name());
+  TRACE_SHOW_TOP(fun,BText("\n   Expand[")+n+",0]="+expand_[n].Name());
   BInt i=n;
   if(responseFunction_.Denominator().Degree()<n)
@@ -130,5 +136,5 @@
   {
     expand_[n] -= expand_[n-i]*responseFunction_.Denominator().Coef(i);
-  //Std(BText("\n  Expand[")+n+","+i+"]="+expand_[n].Name());
+    TRACE_SHOW_TOP(fun,BText("\n  Expand[")+n+","+i+"]="+expand_[n].Name());
   }
   expand_[n] /= responseFunction_.Denominator()[0].Coef();
@@ -143,4 +149,7 @@
 //--------------------------------------------------------------------
 {
+#ifdef TRACE_LEVEL
+  BText fun = BText("  BOutlier::Expand");
+#endif
   if((responseFunction_.Denominator().Degree()==0) &&
      (responseFunction_.Denominator()[0].Coef()!=0))
@@ -155,5 +164,5 @@
     if(n>=size)
     {
-    //Std(BText("\nExpand : n = ")+n+", Size = "+ size +", MaxSize = "+expand_.MaxSize());
+      TRACE_SHOW_TOP(fun,BText("\nExpand : n = ")+n+", Size = "+ size +", MaxSize = "+expand_.MaxSize());
       if(n>=expand_.MaxSize()) { expand_.ReallocBuffer(2*(n+1)); }
       if(n>=expand_.MaxSize()) { expand_.ReallocBuffer(2*(n+1)); }
@@ -207,4 +216,7 @@
 //--------------------------------------------------------------------
 {
+#ifdef TRACE_LEVEL
+  BText fun = BText("  BOutlier::PutAia");
+#endif
   int i, j;
   int length = aia->N_;
@@ -212,5 +224,5 @@
   rat_    = responseFunction_;
   rat_*=aia_->rat_;
-//Std(BText("\n   Length      = ")+length);
+  TRACE_SHOW_TOP(fun,BText("\n   Length      = ")+length);
   BPol expand = rat_ % (length+1);
   x_.ReallocBuffer(length);
@@ -237,5 +249,5 @@
   }
   nearMaxAbs_.AllocBuffer(j);
-//Std(BText("\n   Ratio = ")+rat_.Name()+ " max (" + maxRelative_ +")="+max);
+  TRACE_SHOW_TOP(fun,BText("\n   Ratio = ")+rat_.Name()+ " max (" + maxRelative_ +")="+max);
 }
 
@@ -355,4 +367,7 @@
 //--------------------------------------------------------------------
 {
+#ifdef TRACE_LEVEL
+  BText fun = BText("  BOutlier::RecalcResiduous");
+#endif
   if(!aia_) { return(NIL); }
   t-=maxRelative_;
@@ -360,10 +375,10 @@
   BDat sigma = 0;
   BInt length = aia_->N_;
-//Std(BText("\nRecalcResiduous(")+Name()+","+t+","+w+")");
+  TRACE_SHOW_TOP(fun,BText("\nRecalcResiduous(")+Name()+","+t+","+w+")");
   for(; i<length; i++, j++)
   {
     aia_->res_->Data()[i]-=w*x_[j];
-  //Std(BText("\n  x[")+j+"]="+x_[j].Name());
-  //Std(BText("; Res[")+i+"]="+aia_->res_->Data()[i]);
+    TRACE_SHOW_TOP(fun,BText("\n  x[")+j+"]="+x_[j].Name());
+    TRACE_SHOW_TOP(fun,BText("; Res[")+i+"]="+aia_->res_->Data()[i]);
   }
   aia_->sigma_ = StandardDeviation(aia_->res_->Data()).Value();
@@ -423,9 +438,12 @@
 //--------------------------------------------------------------------
 {
+#ifdef TRACE_LEVEL
+  BText fun = BText("  BAia::Initialize");
+#endif
   BInt o;
   BDat f   = (*res_)[res_->FirstDate()]; //Forzes residuous calculation
   N_  = res_->Data().Size();
-//Std(BText("\nResiduous dates ")+res_->FirstDate().Name()+", "+
-//          res_->LastDate ().Name()+", "+N_);
+  TRACE_SHOW_TOP(fun,BText("\nResiduous dates ")+res_->FirstDate().Name()+", "+
+             res_->LastDate ().Name()+", "+N_);
   sigma_    = StandardDeviation(res_->Data()).Value();
 //Std("\nUsing outlier's types: ");
@@ -433,5 +451,5 @@
   {
     userOutliers_[o]->PutAia(this);
-  //Std(BText("\n  ")+userOutliers_[o]->Name());
+    TRACE_SHOW_TOP(fun,BText("\n  ")+userOutliers_[o]->Name());
   }
 }
@@ -453,5 +471,5 @@
   {
     BReal absRes = Abs(res_->Data()[t]).Value();
-  //Std(BText("\n   ")+absRes+ " <=> " + max);
+    TRACE_SHOW_TOP(fun,BText("\n   ")+absRes+ " <=> " + max);
     if(absRes>max)
     {
Index: tol/btol/bmodel/maia.cpp
===================================================================
--- tol/btol/bmodel/maia.cpp	(revision e4cfd8b0c78d24839af0f2fed3bc2814a1e3d38e)
+++ tol/btol/bmodel/maia.cpp	(revision 75c47a9e5981f2b8150e22f07d8121e44c669e1f)
@@ -63,7 +63,30 @@
 
 //--------------------------------------------------------------------
-  bool BMultOutlier::IsDisjoint(const BMultOutlier& a)
-//--------------------------------------------------------------------
-{
+  bool BMultOutlier::HasInput(BOutlier* outlier, int t) const
+//--------------------------------------------------------------------
+{
+#ifdef TRACE_LEVEL
+  BText fun = BText("  BMultOutlier::HasInput");
+#endif
+  int j;
+  bool has = false;
+  for(j=0; !has&&(j<input_.Size()); j++)
+  {
+    has = input_[j].t_ == t &&
+          input_[j].outlier_ == outlier;
+  }
+  TRACE_SHOW_HIGH(fun, GetExpression()+"\n versus \n"+
+   outlier->GetExpression(t,0)
+   +"\n -> "+has+"\n");
+  return(has);
+};
+
+//--------------------------------------------------------------------
+  bool BMultOutlier::IsDisjoint(const BMultOutlier& a) const
+//--------------------------------------------------------------------
+{
+#ifdef TRACE_LEVEL
+  BText fun = BText("  BMultOutlier::IsDisjoint");
+#endif
   int i, j;
   bool ok = true;
@@ -79,4 +102,5 @@
     }
   }
+  TRACE_SHOW_HIGH(fun, GetExpression()+"\n versus \n"+a.GetExpression()+"\n -> "+ok+"\n");
   return(ok);
 }
@@ -86,11 +110,14 @@
 //--------------------------------------------------------------------
 {
-  int s = input_.Size();
-  input_.ReallocBuffer(s+1);
-  input_[s].index_   = index;
-  input_[s].outlier_ = outlier;
-  input_[s].t_       = t;
-  input_[s].w0_      = w;
-  if(maxIndex_<index) { maxIndex_ = index; }
+  if(!HasInput(outlier, t))
+  {
+    int s = input_.Size();
+    input_.ReallocBuffer(s+1);
+    input_[s].index_   = index;
+    input_[s].outlier_ = outlier;
+    input_[s].t_       = t;
+    input_[s].w0_      = w;
+    if(maxIndex_<index) { maxIndex_ = index; }
+  }
 }
 
@@ -134,5 +161,5 @@
 
 //--------------------------------------------------------------------
-  BText BMultOutlier::GetExpression()
+  BText BMultOutlier::GetExpression() const
 //--------------------------------------------------------------------
 {
@@ -164,5 +191,5 @@
 {
 #ifdef TRACE_LEVEL
-  BText fun = BText("  BOutlier::Estimate");
+  BText fun = BText("  BMultOutlier::Estimate");
 #endif
   TRACE_SHOW_HIGH(fun,"BEGIN");
@@ -370,5 +397,5 @@
 {
 #ifdef TRACE_LEVEL
-  BText fun = BText("  BOutlier::SetResiduals");
+  BText fun = BText("  BMultAia::SetResiduals");
 #endif
   assert(y.Size()==res_->Data().Size());
@@ -432,5 +459,5 @@
 {
 #ifdef TRACE_LEVEL
-  BText fun = BText("  BOutlier::RecalcResiduous");
+  BText fun = BText("  BMultAia::RecalcResiduous");
 #endif
   int s = mo.input_.Size();
@@ -454,5 +481,5 @@
 {
 #ifdef TRACE_LEVEL
-  BText fun = BText("  BAia::SearchMaxAbsRes");
+  BText fun = BText("  BMultAia::SearchMaxAbsRes");
 #endif
   if(optMaxOrder_>=N_) { return(false); }
@@ -497,5 +524,5 @@
 {
 #ifdef TRACE_LEVEL
-  BText fun = BText("  BAia::SearchRefObs");
+  BText fun = BText("  BMultAia::SearchRefObs");
 #endif
   int maxNearRefObs = 3;
@@ -516,6 +543,8 @@
           BMultOutlier& mor = mo[r];
           int t = mr[i].t_-userOutliers_[j]->nearMaxAbs_[k];
-          mor.Add(r,userOutliers_[j],t,0);
-          r++;
+          if(!mor.HasInput(userOutliers_[j],t))
+          {
+            mor.Add(r++,userOutliers_[j],t,0);
+          }
         }
       }
@@ -532,5 +561,5 @@
 {
 #ifdef TRACE_LEVEL
-  BText fun = BText("  BAia::SearchNextMultOutlier");
+  BText fun = BText("  BMultAia::SearchNextMultOutlier");
 #endif
   BComparingInfo minimum;
@@ -717,5 +746,5 @@
 {
 #ifdef TRACE_LEVEL
-  BText fun = BText("  BAia::Input");
+  BText fun = BText("  BMultAia::Input");
 #endif
   if(!input_)
Index: tol/btol/bmodel/tol_bmaia.h
===================================================================
--- tol/btol/bmodel/tol_bmaia.h	(revision e4cfd8b0c78d24839af0f2fed3bc2814a1e3d38e)
+++ tol/btol/bmodel/tol_bmaia.h	(revision 75c47a9e5981f2b8150e22f07d8121e44c669e1f)
@@ -88,6 +88,7 @@
     return(*this);
   }
-  bool IsDisjoint(const BMultOutlier& a);
-  BText GetExpression();
+  bool HasInput(BOutlier* outlier, int t) const;
+  bool IsDisjoint(const BMultOutlier& a) const;
+  BText GetExpression() const;
   void Add(int index, BOutlier* outlier, int t, BDat w);
   void Add(const BMultOutlier& mo);
