Index: trunk/BNC/bncephuser.cpp
===================================================================
--- trunk/BNC/bncephuser.cpp	(revision 3750)
+++ trunk/BNC/bncephuser.cpp	(revision 3751)
@@ -208,6 +208,4 @@
   double  GPSweeks;
   in >> updateInterval >> GPSweek >> GPSweeks >> prn;
-
-  tt.set(GPSweek, GPSweeks);
 
   if      ( messageType == COTYPE_GPSCOMBINED    || 
@@ -226,6 +224,7 @@
     dotDClk    /= t_CST::c;
     dotDotDClk /= t_CST::c;
-    raoSet  = true;
-    dClkSet = true;
+
+    tClk.set(GPSweek, GPSweeks);
+    tRao.set(GPSweek, GPSweeks);
   }
   else if ( messageType == COTYPE_GPSORBIT    || 
@@ -238,23 +237,29 @@
       >> dotRao[0]    >> dotRao[1]    >> dotRao[2]
       >> dotDotRao[0] >> dotDotRao[1] >> dotDotRao[2];
-    raoSet  = true;
+
+    tRao.set(GPSweek, GPSweeks);
   }
   else if ( messageType == COTYPE_GPSCLOCK    || 
             messageType == COTYPE_GLONASSCLOCK ) {
-    int dummyIOD;
-    dClk       = 0.0;
-    dotDClk    = 0.0;
-    dotDotDClk = 0.0;
-    in >> dummyIOD >> dClk >> dotDClk >> dotDotDClk;
-    dClk       /= t_CST::c;
-    dotDClk    /= t_CST::c;
-    dotDotDClk /= t_CST::c;
-    dClkSet = true;
+    if (tRao.valid()) {
+      int dummyIOD;
+      dClk       = 0.0;
+      dotDClk    = 0.0;
+      dotDotDClk = 0.0;
+      in >> dummyIOD >> dClk >> dotDClk >> dotDotDClk;
+      dClk       /= t_CST::c;
+      dotDClk    /= t_CST::c;
+      dotDotDClk /= t_CST::c;
+
+      tClk.set(GPSweek, GPSweeks);
+    }
   }
   else if ( messageType == COTYPE_GPSHR    ||
             messageType == COTYPE_GLONASSHR ) {
-    int dummyIOD;
-    in >> dummyIOD >> hrClk;
-    hrClk /= t_CST::c; 
+    if (tRao.valid() && tClk.valid()) {
+      int dummyIOD;
+      in >> dummyIOD >> hrClk;
+      hrClk /= t_CST::c; 
+    }
   }
 
Index: trunk/BNC/bncephuser.h
===================================================================
--- trunk/BNC/bncephuser.h	(revision 3750)
+++ trunk/BNC/bncephuser.h	(revision 3751)
@@ -40,10 +40,21 @@
  public:
   t_corr() {
-    raoSet  = false;
-    dClkSet = false;
-    eph     = 0;
-    hrClk   = 0.0;
+    rao.ReSize(3);       
+    dotRao.ReSize(3);    
+    dotDotRao.ReSize(3); 
+    iod        = 0;
+    dClk       = 0.0;
+    dotDClk    = 0.0;
+    dotDotDClk = 0.0;
+    hrClk      = 0.0;
+    rao        = 0.0;
+    dotRao     = 0.0;
+    dotDotRao  = 0.0;
+    eph        = 0;
   }
-  bool ready() {return raoSet && dClkSet;}
+  
+  ~t_corr() {}
+
+  bool ready() {return tRao.valid() && tClk.valid();}
 
   static bool relevantMessageType(int msgType) {
@@ -61,5 +72,6 @@
 
   QString      prn;
-  bncTime      tt;
+  bncTime      tClk;
+  bncTime      tRao;
   int          iod;
   double       dClk;
@@ -70,6 +82,4 @@
   ColumnVector dotRao;
   ColumnVector dotDotRao;
-  bool         raoSet;
-  bool         dClkSet;
   const t_eph* eph;
 };
Index: trunk/BNC/bncpppclient.cpp
===================================================================
--- trunk/BNC/bncpppclient.cpp	(revision 3750)
+++ trunk/BNC/bncpppclient.cpp	(revision 3751)
@@ -271,13 +271,4 @@
   }
 
-  // Remove All Corrections
-  // ----------------------
-  //  QMapIterator<QString, t_corr*> ic(_corr);
-  //  while (ic.hasNext()) {
-  //    ic.next();
-  //    delete ic.value();
-  //  }
-  //  _corr.clear();
-
   QListIterator<QString> it(corrList);
   while (it.hasNext()) {
@@ -303,5 +294,5 @@
 
       cc->readLine(line);
-      _corr_tt = cc->tt;
+      _corr_tt = cc->tClk;
     }
     else if ( messageType == BTYPE_GPS ) { 
@@ -337,13 +328,4 @@
   }
 
-  QMutableMapIterator<QString, t_corr*> im(_corr);
-  while (im.hasNext()) {
-    im.next();
-    t_corr* cc = im.value();
-    if (!cc->ready()) {
-      delete cc;
-      im.remove();
-    }
-  }
 }
 
@@ -360,5 +342,5 @@
       if (_corr.contains(prn)) {
         t_corr* cc = _corr.value(prn);
-        if (tt - cc->tt < MAXAGE) {
+        if (cc->ready() && tt - cc->tClk < MAXAGE) {
           t_eph*  eLast = _eph.value(prn)->last;
           t_eph*  ePrev = _eph.value(prn)->prev;
@@ -390,6 +372,7 @@
                               ColumnVector& xc, ColumnVector& vv) {
 
-  double dt = tt - cc->tt;
-  ColumnVector raoHlp = cc->rao + cc->dotRao * dt + cc->dotDotRao * dt * dt;
+  double dtRao = tt - cc->tRao;
+  ColumnVector raoHlp = cc->rao + cc->dotRao * dtRao 
+                      + cc->dotDotRao * dtRao * dtRao;
 
   if (raoHlp.norm_Frobenius() > 20.0) {
@@ -402,5 +385,8 @@
   xc[1] -= dx[1];
   xc[2] -= dx[2];
-  xc[3] += cc->dClk + cc->dotDClk * dt + cc->dotDotDClk * dt * dt
+
+  double dtClk = tt - cc->tClk;
+
+  xc[3] += cc->dClk + cc->dotDClk * dtClk + cc->dotDotDClk * dtClk * dtClk
         + cc->hrClk;
 
Index: trunk/BNC/combination/bnccomb.cpp
===================================================================
--- trunk/BNC/combination/bnccomb.cpp	(revision 3750)
+++ trunk/BNC/combination/bnccomb.cpp	(revision 3751)
@@ -309,5 +309,5 @@
   // Save Orbit-Only Corrections
   // ---------------------------
-  if (newCorr->raoSet && !newCorr->dClkSet) {
+  if (newCorr->tRao.valid() && !newCorr->tClk.valid()) {
     QString corrID = newCorr->ID();
     if (_orbitCorrs.find(corrID) != _orbitCorrs.end()) {
@@ -320,5 +320,5 @@
   // Merge with saved orbit correction
   // ---------------------------------
-  else if (newCorr->dClkSet && !newCorr->raoSet) {
+  else if (newCorr->tClk.valid() && !newCorr->tRao.valid()) {
     QString corrID = newCorr->ID();
     if (_orbitCorrs.find(corrID) != _orbitCorrs.end()) {
@@ -329,5 +329,5 @@
   // Check Modulo Time
   // -----------------
-  if (int(newCorr->tt.gpssec()) % moduloTime != 0.0) {
+  if (int(newCorr->tClk.gpssec()) % moduloTime != 0.0) {
     delete newCorr;
     return;
@@ -336,5 +336,5 @@
   // Delete old corrections
   // ----------------------
-  if (_resTime.valid() && newCorr->tt <= _resTime) {
+  if (_resTime.valid() && newCorr->tClk <= _resTime) {
     delete newCorr;
     return;
@@ -368,5 +368,5 @@
   while (itTime.hasNext()) {
     bncTime epoTime = itTime.next();
-    if (epoTime < newCorr->tt - moduloTime) {
+    if (epoTime < newCorr->tClk - moduloTime) {
       _resTime = epoTime;
       processEpoch();
@@ -376,5 +376,5 @@
   // Merge or add the correction
   // ---------------------------
-  QVector<cmbCorr*>& corrs = _buffer[newCorr->tt].corrs;
+  QVector<cmbCorr*>& corrs = _buffer[newCorr->tClk].corrs;
   cmbCorr* existingCorr = 0;
   QVectorIterator<cmbCorr*> itCorr(corrs);
@@ -406,10 +406,10 @@
   ColumnVector oldXC(4);
   ColumnVector oldVV(3);
-  corr->eph->position(corr->tt.gpsw(), corr->tt.gpssec(), 
+  corr->eph->position(corr->tRao.gpsw(), corr->tRao.gpssec(), 
                       oldXC.data(), oldVV.data());
 
   ColumnVector newXC(4);
   ColumnVector newVV(3);
-  lastEph->position(corr->tt.gpsw(), corr->tt.gpssec(), 
+  lastEph->position(corr->tRao.gpsw(), corr->tRao.gpssec(), 
                     newXC.data(), newVV.data());
 
@@ -1154,20 +1154,11 @@
 t_irc bncComb::mergeOrbitCorr(const cmbCorr* orbitCorr, cmbCorr* clkCorr) {
 
-  double dt = clkCorr->tt - orbitCorr->tt;
-
-  clkCorr->iod = orbitCorr->iod; // is it always correct?
-  clkCorr->eph = orbitCorr->eph; 
-
-  clkCorr->rao = orbitCorr->rao 
-               + orbitCorr->dotRao    * dt
-               + orbitCorr->dotDotRao * dt * dt;
-
-  clkCorr->dotRao = orbitCorr->dotRao
-                  + orbitCorr->dotDotRao * dt;
-
+  clkCorr->iod       = orbitCorr->iod; // is it always correct?
+  clkCorr->eph       = orbitCorr->eph; 
+  clkCorr->tRao      = orbitCorr->tRao;
+  clkCorr->rao       = orbitCorr->rao;
+  clkCorr->dotRao    = orbitCorr->dotRao;
   clkCorr->dotDotRao = orbitCorr->dotDotRao;
 
-  clkCorr->raoSet = true;
-
   return success;
 }
