diff --git a/src/sync-logic.cc b/src/sync-logic.cc
index 56692e5..86fb69b 100644
--- a/src/sync-logic.cc
+++ b/src/sync-logic.cc
@@ -17,7 +17,7 @@
  *
  * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
  *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
  *         Yingdi Yu <yingdi@cs.ucla.edu>
  */
 
@@ -61,7 +61,7 @@
 
 SyncLogic::SyncLogic (const Name& syncPrefix,
                       const IdentityCertificate& myCertificate,
-                      shared_ptr<Validator> validator, 
+                      shared_ptr<Validator> validator,
                       shared_ptr<Face> face,
                       LogicUpdateCallback onUpdate,
                       LogicRemoveCallback onRemove)
@@ -79,11 +79,11 @@
   , m_rangeUniformRandom (m_randomGenerator, boost::uniform_int<> (200,1000))
   , m_reexpressionJitter (m_randomGenerator, boost::uniform_int<> (100,500))
   , m_recoveryRetransmissionInterval (m_defaultRecoveryRetransmitInterval)
-{ 
-  m_syncRegisteredPrefixId = m_face->setInterestFilter (m_syncPrefix, 
-                                                        bind(&SyncLogic::onSyncInterest, this, _1, _2), 
+{
+  m_syncRegisteredPrefixId = m_face->setInterestFilter (m_syncPrefix,
+                                                        bind(&SyncLogic::onSyncInterest, this, _1, _2),
                                                         bind(&SyncLogic::onSyncRegisterFailed, this, _1, _2));
-  
+
 
   m_reexpressingInterestId = m_scheduler.scheduleEvent (time::seconds (0), // no need to add jitter
                                                         bind (&SyncLogic::sendSyncInterest, this));
@@ -109,9 +109,9 @@
   , m_rangeUniformRandom (m_randomGenerator, boost::uniform_int<> (200,1000))
   , m_reexpressionJitter (m_randomGenerator, boost::uniform_int<> (100,500))
   , m_recoveryRetransmissionInterval (m_defaultRecoveryRetransmitInterval)
-{ 
-  m_syncRegisteredPrefixId = m_face->setInterestFilter (m_syncPrefix, 
-                                                        bind(&SyncLogic::onSyncInterest, this, _1, _2), 
+{
+  m_syncRegisteredPrefixId = m_face->setInterestFilter (m_syncPrefix,
+                                                        bind(&SyncLogic::onSyncInterest, this, _1, _2),
                                                         bind(&SyncLogic::onSyncRegisterFailed, this, _1, _2));
 
   m_reexpressingInterestId = m_scheduler.scheduleEvent (time::seconds (0), // no need to add jitter
@@ -119,8 +119,8 @@
 }
 
 SyncLogic::~SyncLogic ()
-{ 
-  m_face->unsetInterestFilter(m_syncRegisteredPrefixId); 
+{
+  m_face->unsetInterestFilter(m_syncRegisteredPrefixId);
   m_scheduler.cancelEvent (m_reexpressingInterestId);
   m_scheduler.cancelEvent (m_delayedInterestProcessingId);
 }
@@ -128,7 +128,7 @@
 /**
  * Two types of intersts
  *
- * Normal name:    .../<hash>  
+ * Normal name:    .../<hash>
  * Recovery name:  .../recovery/<hash>
  */
 boost::tuple<DigestConstPtr, std::string>
@@ -139,10 +139,10 @@
   int nameLengthDiff = name.size() - m_syncPrefix.size();
   BOOST_ASSERT (nameLengthDiff > 0);
   BOOST_ASSERT (nameLengthDiff < 3);
-  
+
   std::string hash = name.get(-1).toEscapedString();
   std::string interestType;
-  
+
   if(nameLengthDiff == 1)
     interestType = "normal";
   else
@@ -180,7 +180,7 @@
         {
           processSyncInterest (name, digest);
         }
-      else if (type == "recovery") 
+      else if (type == "recovery")
         {
           processSyncRecoveryInterest (name, digest);
         }
@@ -204,13 +204,13 @@
 {
   OnDataValidated onValidated = bind(&SyncLogic::onSyncDataValidated, this, _1);
   OnDataValidationFailed onValidationFailed = bind(&SyncLogic::onSyncDataValidationFailed, this, _1);
-  m_validator->validate(data, onValidated, onValidationFailed); 
+  m_validator->validate(data, onValidated, onValidationFailed);
 }
 
 void
 SyncLogic::onSyncTimeout(const ndn::Interest& interest)
-{ 
-  // It is OK. Others will handle the time out situation. 
+{
+  // It is OK. Others will handle the time out situation.
 }
 
 void
@@ -229,7 +229,7 @@
   try
     {
       _LOG_DEBUG_ID ("<< D " << name);
-  
+
       DigestConstPtr digest;
       std::string type;
       tie (digest, type) = convertNameToDigestAndType (name);
@@ -265,7 +265,7 @@
   // Special case when state is not empty and we have received request with zero-root digest
   if (digest->isZero () && !rootDigest->isZero ())
     {
-      
+
       SyncStateMsg ssm;
       {
         ssm << (*m_state);
@@ -280,7 +280,7 @@
       m_syncInterestTable.insert (digest, name.toUri(), false);
       return;
     }
-  
+
   DiffStateContainer::iterator stateInDiffLog = m_log.find (digest);
 
   if (stateInDiffLog != m_log.end ())
@@ -300,7 +300,7 @@
           m_scheduler.cancelEvent (m_delayedInterestProcessingId);
         }
 
-      uint32_t waitDelay = GET_RANDOM (m_rangeUniformRandom);      
+      uint32_t waitDelay = GET_RANDOM (m_rangeUniformRandom);
       _LOG_DEBUG_ID ("Digest is not in the log. Schedule processing after small delay: " << time::milliseconds (waitDelay));
 
       m_delayedInterestProcessingId = m_scheduler.scheduleEvent (time::milliseconds (waitDelay),
@@ -309,7 +309,7 @@
   else
     {
       _LOG_DEBUG_ID ("                                                      (timed processing)");
-      
+
       m_recoveryRetransmissionInterval = m_defaultRecoveryRetransmitInterval;
       sendSyncRecoveryInterests (digest);
     }
@@ -320,7 +320,7 @@
 {
   DiffStatePtr diffLog = boost::make_shared<DiffState> ();
   bool ownInterestSatisfied = false;
-  
+
   try
     {
 
@@ -330,7 +330,7 @@
 
       DiffState diff;
       SyncStateMsg msg;
-      if (!msg.ParseFromArray(wireData, len) || !msg.IsInitialized()) 
+      if (!msg.ParseFromArray(wireData, len) || !msg.IsInitialized())
       {
         //Throw
         BOOST_THROW_EXCEPTION (Error::SyncStateMsgDecodingFailure () );
@@ -404,7 +404,7 @@
             }
         }
 
-      if (!v.empty()) 
+      if (!v.empty())
       {
         if (!m_perBranch)
         {
@@ -430,7 +430,7 @@
 
       // this is kind of wrong
       // satisfyPendingSyncInterests (diffLog); // if there are interests in PIT, there is a point to satisfy them using new state
-  
+
       // if state has changed, then it is safe to express a new interest
       time::system_clock::Duration after = time::milliseconds(GET_RANDOM (m_reexpressionJitter));
       // cout << "------------ reexpress interest after: " << after << endl;
@@ -472,7 +472,7 @@
         /// @todo Impose limit on how many state info should be send out
       }
   }
-  
+
   try
     {
       uint32_t counter = 0;
@@ -501,9 +501,9 @@
 }
 
 void
-SyncLogic::insertToDiffLog (DiffStatePtr diffLog) 
+SyncLogic::insertToDiffLog (DiffStatePtr diffLog)
 {
-  diffLog->setDigest (m_state->getDigest());  
+  diffLog->setDigest (m_state->getDigest());
   if (m_log.size () > 0)
     {
       m_log.get<sequenced> ().front ()->setNext (diffLog);
@@ -527,23 +527,23 @@
     m_state->update(info, seqN);
 
     _LOG_DEBUG_ID ("addLocalNames (): new state " << *m_state->getDigest ());
-    
+
     diff = boost::make_shared<DiffState>();
     diff->update(info, seqN);
     insertToDiffLog (diff);
   }
 
   // _LOG_DEBUG_ID ("PIT size: " << m_syncInterestTable.size ());
-  satisfyPendingSyncInterests (diff);  
+  satisfyPendingSyncInterests (diff);
 }
 
 void
-SyncLogic::remove(const Name &prefix) 
+SyncLogic::remove(const Name &prefix)
 {
   DiffStatePtr diff;
   {
     NameInfoConstPtr info = StdNameInfo::FindOrCreate(prefix.toUri());
-    m_state->remove(info);	
+    m_state->remove(info);
 
     // increment the sequence number for the forwarder node
     NameInfoConstPtr forwarderInfo = StdNameInfo::FindOrCreate(forwarderPrefix);
@@ -564,7 +564,7 @@
     insertToDiffLog (diff);
   }
 
-  satisfyPendingSyncInterests (diff);  
+  satisfyPendingSyncInterests (diff);
 }
 
 void
@@ -600,14 +600,14 @@
 {
   std::ostringstream os;
   os << *digest;
-  
+
   Name interestName = m_syncPrefix;
   interestName.append("recovery").append(os.str());
 
   time::system_clock::Duration nextRetransmission = time::milliseconds (m_recoveryRetransmissionInterval + GET_RANDOM (m_reexpressionJitter));
 
   m_recoveryRetransmissionInterval <<= 1;
-    
+
   m_scheduler.cancelEvent (m_reexpressingRecoveryInterestId);
   if (m_recoveryRetransmissionInterval < 100*1000) // <100 seconds
     m_reexpressingRecoveryInterestId = m_scheduler.scheduleEvent (nextRetransmission,
@@ -643,11 +643,11 @@
   Data syncData(name);
   syncData.setContent(reinterpret_cast<const uint8_t*>(wireData), size);
   syncData.setFreshnessPeriod(time::milliseconds(m_syncResponseFreshness));
-  
+
   m_keyChain.sign(syncData, m_myCertificate.getName());
-  
+
   m_face->put(syncData);
-  
+
   delete []wireData;
 
   // checking if our own interest got satisfied
@@ -655,11 +655,11 @@
   {
     satisfiedOwnInterest = (m_outstandingInterestName == name);
   }
-  
+
   if (satisfiedOwnInterest)
     {
       _LOG_DEBUG_ID ("Satisfied our own Interest. Re-expressing (hopefully with a new digest)");
-      
+
       time::system_clock::Duration after = time::milliseconds(GET_RANDOM (m_reexpressionJitter));
       // cout << "------------ reexpress interest after: " << after << endl;
       EventId eventId = m_scheduler.scheduleEvent (after,
@@ -670,7 +670,7 @@
 }
 
 std::string
-SyncLogic::getRootDigest() 
+SyncLogic::getRootDigest()
 {
   std::ostringstream os;
   os << *m_state->getDigest();
