diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 49886e0..fe4ba01 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -47,14 +47,12 @@
     int
     Nlsr::usage(const string& progname)
     {
-
         cout << "Usage: " << progname << " [OPTIONS...]"<<endl;
         cout << "   NDN routing...." << endl;
         cout << "       -d, --daemon        Run in daemon mode" << endl;
         cout << "       -f, --config_file   Specify configuration file name" <<endl;
         cout << "       -p, --api_port      port where api client will connect" <<endl;
         cout << "       -h, --help          Display this help message" << endl;
-
         exit(EXIT_FAILURE);
     }
 
@@ -69,7 +67,6 @@
     nlsr::Nlsr nlsr_;
     string programName(argv[0]);
     nlsr_.setConfFileName("nlsr.conf");
-
     int opt;
     while ((opt = getopt(argc, argv, "df:p:h")) != -1)
     {
@@ -95,15 +92,12 @@
                 return EXIT_FAILURE;
         }
     }
-
-
     ConfFileProcessor cfp(nlsr_.getConfFileName());
     int res=cfp.processConfFile(nlsr_);
     if ( res < 0 )
     {
         return EXIT_FAILURE;
     }
-
     nlsr_.getConfParameter().buildRouterPrefix();
     nlsr_.getNlsrLogger().initNlsrLogger(nlsr_.getConfParameter().getLogDir());
     //src::logger lg;
@@ -116,27 +110,17 @@
     nlsr_.getFib().setFibEntryRefreshTime(
         2*nlsr_.getConfParameter().getLsaRefreshTime());
     nlsr_.getLsdb().setThisRouterPrefix(nlsr_.getConfParameter().getRouterPrefix());
-
     /* debugging purpose start */
     cout <<	nlsr_.getConfParameter();
     nlsr_.getAdl().printAdl();
     nlsr_.getNpl().printNpl();
     /* debugging purpose end */
-
     nlsr_.getLsdb().buildAndInstallOwnNameLsa(nlsr_);
     nlsr_.getLsdb().buildAndInstallOwnCorLsa(nlsr_);
-
-
-
-
     nlsr_.setInterestFilterNlsr(nlsr_.getConfParameter().getRouterPrefix());
     nlsr_.getIm().scheduleInfoInterest(nlsr_,1);
     //testing purpose
     nlsr_.getNlsrTesting().schedlueAddingLsas(nlsr_);
-
-
-
-
     try
     {
         nlsr_.startEventLoop();
@@ -145,6 +129,5 @@
     {
         std::cerr << "ERROR: " << e.what() << std::endl;
     }
-
     return EXIT_SUCCESS;
 }
diff --git a/src/nlsr_adl.cpp b/src/nlsr_adl.cpp
index 64976d7..0d47e67 100644
--- a/src/nlsr_adl.cpp
+++ b/src/nlsr_adl.cpp
@@ -14,7 +14,6 @@
 
     Adl::~Adl()
     {
-
     }
 
     static bool
@@ -51,36 +50,28 @@
     Adl::updateAdjacentStatus(string adjName, int s)
     {
         Adjacent adj(adjName);
-
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it == adjList.end())
         {
             return -1;
         }
-
         (*it).setStatus(s);
         return 0;
-
-
     }
 
     Adjacent
     Adl::getAdjacent(string adjName)
     {
         Adjacent adj(adjName);
-
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it != adjList.end())
         {
             return (*it);
         }
-
         return adj;
     }
 
@@ -92,13 +83,10 @@
         {
             return false;
         }
-
         adjList.sort(adjacent_compare);
         adl.getAdjList().sort(adjacent_compare);
         int equalAdjCount=0;
-
         std::list< Adjacent > adjList2=adl.getAdjList();
-
         std::list<Adjacent>::iterator it1;
         std::list<Adjacent>::iterator it2;
         for(it1=adjList.begin() , it2=adjList2.begin() ;
@@ -110,7 +98,6 @@
             }
             equalAdjCount++;
         }
-
         return equalAdjCount==getAdlSize();
     }
 
@@ -119,19 +106,15 @@
     Adl::updateAdjacentLinkCost(string adjName, double lc)
     {
         Adjacent adj(adjName);
-
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it == adjList.end())
         {
             return -1;
         }
-
         (*it).setLinkCost(lc);
         return 0;
-
     }
 
     bool
@@ -141,12 +124,10 @@
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it == adjList.end())
         {
             return false;
         }
-
         return true;
     }
 
@@ -157,14 +138,11 @@
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it == adjList.end())
         {
             return ;
         }
-
         (*it).setInterestTimedOutNo((*it).getInterestTimedOutNo()+1);
-
     }
 
     void
@@ -174,7 +152,6 @@
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it != adjList.end())
         {
             (*it).setInterestTimedOutNo(count);
@@ -188,12 +165,10 @@
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it == adjList.end())
         {
             return -1;
         }
-
         return (*it).getInterestTimedOutNo();
     }
 
@@ -204,12 +179,10 @@
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it == adjList.end())
         {
             return -1;
         }
-
         return (*it).getStatus();
     }
 
@@ -220,7 +193,6 @@
         std::list<Adjacent >::iterator it = std::find_if( adjList.begin(),
                                             adjList.end(),
                                             bind(&adjacent_compare, _1, adj));
-
         if( it != adjList.end())
         {
             (*it).setStatus(status);
@@ -253,12 +225,10 @@
                 }
             }
         }
-
         if( nbrCount == adjList.size())
         {
             return true;
         }
-
         return false;
     }
 
@@ -274,7 +244,6 @@
                 actNbrCount++;
             }
         }
-
         return actNbrCount;
     }
 
diff --git a/src/nlsr_conf_param.cpp b/src/nlsr_conf_param.cpp
index d307b83..1fc0e41 100644
--- a/src/nlsr_conf_param.cpp
+++ b/src/nlsr_conf_param.cpp
@@ -26,7 +26,6 @@
         os  <<"Hyp R: "<< cfp.getCorR()<<endl;
         os  <<"Hyp theta: "<< cfp.getCorTheta()<<endl;
         os  <<"Tunnel Type: "<< cfp.getTunnelType()<<endl;
-
         return os;
     }
 
diff --git a/src/nlsr_conf_param.hpp b/src/nlsr_conf_param.hpp
index 61b7e42..b2413ba 100644
--- a/src/nlsr_conf_param.hpp
+++ b/src/nlsr_conf_param.hpp
@@ -17,7 +17,6 @@
             ,chronosyncLsaPrefix("/ndn/nlsr/LSA")
         {
             isStrictHierchicalKeyCheck=0;
-
             interestRetryNumber=3;
             interestResendTime=5;
             infoInterestInterval=60;
diff --git a/src/nlsr_conf_processor.cpp b/src/nlsr_conf_processor.cpp
index 8fc7419..fd9e217 100644
--- a/src/nlsr_conf_processor.cpp
+++ b/src/nlsr_conf_processor.cpp
@@ -19,7 +19,6 @@
     ConfFileProcessor::processConfFile(Nlsr& pnlsr)
     {
         int ret=0;
-
         if ( !confFileName.empty())
         {
             std::ifstream inputFile(confFileName.c_str());
@@ -47,7 +46,6 @@
                 ret=-1;
             }
         }
-
         return ret;
     }
 
@@ -129,7 +127,6 @@
         {
             cout << "Wrong configuration Command: "<< nt.getFirstToken()<<endl;
         }
-
         return ret;
     }
 
@@ -438,11 +435,9 @@
             nlsrTokenizer nt(command," ");
             stringstream ssr(nt.getFirstToken().c_str());
             stringstream sst(nt.getRestOfLine().c_str());
-
             double r,theta;
             ssr>>r;
             sst>>theta;
-
             pnlsr.getConfParameter().setCorR(r);
             pnlsr.getConfParameter().setCorTheta(theta);
         }
@@ -507,10 +502,8 @@
         {
             nlsrTokenizer nt(command," ");
             stringstream sst(nt.getRestOfLine().c_str());
-
             double cost;
             sst>>cost;
-
             pnlsr.getAdl().updateAdjacentLinkCost(nt.getFirstToken(),cost);
         }
         return 0;
diff --git a/src/nlsr_dm.cpp b/src/nlsr_dm.cpp
index 8252423..a88951b 100644
--- a/src/nlsr_dm.cpp
+++ b/src/nlsr_dm.cpp
@@ -16,22 +16,17 @@
     DataManager::processContent(Nlsr& pnlsr, const ndn::Interest &interest,
                                 const ndn::Data & data)
     {
-
         cout << "I: " << interest.toUri() << endl;
-
         string dataName(data.getName().toUri());
         string dataContent((char *)data.getContent().value());
-
         cout << "D: " << dataName << endl;
         cout << "Data Content: " << dataContent << endl;
-
         nlsrTokenizer nt(dataName,"/");
         string chkString("info");
         if( nt.doesTokenExist(chkString) )
         {
             processContentInfo(pnlsr,dataName,dataContent);
         }
-
     }
 
     void
@@ -50,20 +45,16 @@
         cout<<"Status: "<< oldStatus << endl;
         cout<<"Info Interest Timed out: "<< infoIntTimedOutCount <<endl;
         //debugging purpose end
-
         pnlsr.getAdl().setStatusOfNeighbor(neighbor,1);
         pnlsr.getAdl().setTimedOutInterestCount(neighbor,0);
-
         int newStatus=pnlsr.getAdl().getStatusOfNeighbor(neighbor);
         infoIntTimedOutCount=pnlsr.getAdl().getTimedOutInterestCount(neighbor);
-
         //debugging purpose
         cout <<"After Updates: " <<endl;
         cout <<"Neighbor : "<<neighbor<<endl;
         cout<<"Status: "<< newStatus << endl;
         cout<<"Info Interest Timed out: "<< infoIntTimedOutCount <<endl;
         //debugging purpose end
-
         if ( ( oldStatus-newStatus)!= 0 ) // change in Adjacency list
         {
             pnlsr.incrementAdjBuildCount();
@@ -76,7 +67,6 @@
                                                    ndn::bind(&Lsdb::scheduledAdjLsaBuild, pnlsr.getLsdb(),
                                                            boost::ref(pnlsr)));
             }
-
         }
     }
 
diff --git a/src/nlsr_fe.cpp b/src/nlsr_fe.cpp
index f0f9d06..5f4811c 100644
--- a/src/nlsr_fe.cpp
+++ b/src/nlsr_fe.cpp
@@ -18,7 +18,6 @@
         {
             int nhCount=0;
             std::list<NextHop>::iterator it1, it2;
-
             for ( it1=nhl.getNextHopList().begin(),
                     it2 = nhlOther.getNextHopList().begin() ;
                     it1 != nhl.getNextHopList().end() ; it1++, it2++)
@@ -33,7 +32,6 @@
                     break;
                 }
             }
-
             return nhCount == nhl.getNhlSize();
         }
     }
diff --git a/src/nlsr_fib.cpp b/src/nlsr_fib.cpp
index 4ff49b2..8fb7928 100644
--- a/src/nlsr_fib.cpp
+++ b/src/nlsr_fib.cpp
@@ -34,7 +34,6 @@
     void
     Fib::refreshFibEntry(string name, int feSeqNum)
     {
-
     }
 
     void
@@ -76,7 +75,6 @@
                 {
                     (*it).getNhl().addNextHop((*nhit));
                 }
-
                 (*it).setTimeToRefresh(fibEntryRefreshTime);
             }
             (*it).getNhl().sortNhl();
@@ -101,9 +99,7 @@
             newEntry.setTimeToRefresh(fibEntryRefreshTime);
             newEntry.setFeSeqNo(1);
             fibTable.push_back(newEntry);
-
             //cancelScheduledFeExpiringEvent(pnlsr, newEntry().getFeExpiringEventId());
-
             //Update NDN-FIB
         }
     }
@@ -122,7 +118,6 @@
                 //remove entry from NDN-FIB
             }
         }
-
         if ( fibTable.size() > 0 )
         {
             fibTable.clear();
@@ -156,7 +151,6 @@
         {
             return maxFacesPerPrefix;
         }
-
         return endFace;
     }
 
diff --git a/src/nlsr_im.cpp b/src/nlsr_im.cpp
index 29c0fcd..23a56cc 100644
--- a/src/nlsr_im.cpp
+++ b/src/nlsr_im.cpp
@@ -20,7 +20,6 @@
                                       const ndn::Name &name,
                                       const ndn::Interest &interest)
     {
-
         cout << "<< I: " << interest << endl;
         string intName=interest.getName().toUri();
         cout << "Interest Received for Name: "<< intName <<endl;
@@ -32,7 +31,6 @@
             cout <<"Neighbor: " << nbr <<endl;
             processInterestInfo(pnlsr,nbr,interest);
         }
-
         //Data data(ndn::Name(interest->getName()).append("testApp").appendVersion());
         //data.setFreshnessPeriod(1000); // 10 sec
         //data.setContent((const uint8_t*)"HELLO KITTY", sizeof("HELLO KITTY"));
@@ -53,7 +51,6 @@
             pnlsr.getKeyChain().sign(data);
             cout << ">> D: " << data << endl;
             pnlsr.getNlsrFace().put(data);
-
             int status=pnlsr.getAdl().getStatusOfNeighbor(neighbor);
             if ( status == 0 )
             {
@@ -79,7 +76,6 @@
                        +nt.getTokenString(0,nt.getTokenPosition(chkString)-1);
             processInterestTimedOutInfo( pnlsr , nbr , interest);
         }
-
     }
 
     void
@@ -92,7 +88,6 @@
         cout<<"Neighbor: "<< neighbor << endl;
         cout<<"Status: "<< status << endl;
         cout<<"Info Interest Timed out: "<< infoIntTimedOutCount <<endl;
-
         if((infoIntTimedOutCount < pnlsr.getConfParameter().getInterestRetryNumber()))
         {
             string intName=neighbor +"/"+"info"+
@@ -114,7 +109,6 @@
                                                            boost::ref(pnlsr)));
             }
         }
-
     }
 
     void
@@ -125,7 +119,6 @@
         //i.setScope(scope);
         i.setInterestLifetime(seconds*1000);
         i.setMustBeFresh(true);
-
         pnlsr.getNlsrFace().expressInterest(i,
                                             ndn::func_lib::bind(&DataManager::processContent,
                                                     &pnlsr.getDm(), boost::ref(pnlsr),_1, _2),
@@ -145,9 +138,7 @@
             expressInterest(	pnlsr,adjName,2,
                                 pnlsr.getConfParameter().getInterestResendTime());
         }
-
         scheduleInfoInterest(pnlsr, pnlsr.getConfParameter().getInfoInterestInterval());
-
     }
 
     void
diff --git a/src/nlsr_logger.cpp b/src/nlsr_logger.cpp
index 5b97ac4..804ef98 100644
--- a/src/nlsr_logger.cpp
+++ b/src/nlsr_logger.cpp
@@ -23,7 +23,6 @@
         {
             homeDirPath = getenv("HOME");
         }
-
         return homeDirPath;
     }
 
@@ -36,7 +35,6 @@
             logDirPath=getUserHomeDirectory()+"/nlsrLog";
         }
         cout<<"Log Dir Path: "<< logDirPath<<endl;
-
         typedef sinks::synchronous_sink< sinks::text_file_backend > file_sink;
         shared_ptr< file_sink > sink(new file_sink(
                                          keywords::file_name = logDirPath
@@ -50,13 +48,11 @@
                     keywords::max_size = 16 * 1024 * 1024 * 1024,
                     keywords::min_free_space = 128 * 1024 * 1024
                 ));
-
         sink->set_formatter(
             expr::format("%1%: %2%")
             % getEpochTime()
             % expr::smessage
         );
-
         logging::core::get()->add_sink(sink);
     }
 
diff --git a/src/nlsr_lsa.cpp b/src/nlsr_lsa.cpp
index 5adb854..f238bce 100644
--- a/src/nlsr_lsa.cpp
+++ b/src/nlsr_lsa.cpp
@@ -29,14 +29,11 @@
         lsType=lst;
         lsSeqNo=lsn;
         lifeTime=lt;
-
         std::list<string> nl=npl.getNameList();
         for( std::list<string>::iterator it=nl.begin(); it != nl.end(); it++)
         {
             addNameToLsa((*it));
         }
-
-
     }
 
     string
@@ -48,14 +45,12 @@
                     + boost::lexical_cast<std::string>(lifeTime);
         nameLsaData+="|";
         nameLsaData+=boost::lexical_cast<std::string>(npl.getNplSize());
-
         std::list<string> nl=npl.getNameList();
         for( std::list<string>::iterator it=nl.begin(); it != nl.end(); it++)
         {
             nameLsaData+="|";
             nameLsaData+=(*it);
         }
-
         return nameLsaData;
     }
 
@@ -74,7 +69,6 @@
         {
             os<<"    Name "<<i<<": "<<(*it)<<endl;
         }
-
         return os;
     }
 
@@ -118,7 +112,6 @@
         corLsaData+=(boost::lexical_cast<std::string>(lifeTime) + "|");
         corLsaData+=(boost::lexical_cast<std::string>(corRad) + "|");
         corLsaData+=(boost::lexical_cast<std::string>(corTheta) + "|");
-
         return corLsaData;
     }
 
@@ -132,7 +125,6 @@
         os<<"  Ls Lifetime: "<<(unsigned int)cLsa.getLifeTime()<<endl;
         os<<"    Hyperbolic Radius: "<<cLsa.getCorRadius()<<endl;
         os<<"    Hyperbolic Theta: "<<cLsa.getCorTheta()<<endl;
-
         return os;
     }
 
@@ -145,7 +137,6 @@
         lsSeqNo=lsn;
         lifeTime=lt;
         noLink=nl;
-
         std::list<Adjacent> al=padl.getAdjList();
         for( std::list<Adjacent>::iterator it=al.begin(); it != al.end(); it++)
         {
@@ -180,7 +171,6 @@
                    + boost::lexical_cast<std::string>(lifeTime);
         adjLsaData+="|";
         adjLsaData+=boost::lexical_cast<std::string>(adl.getAdlSize());
-
         std::list<Adjacent> al=adl.getAdjList();
         for( std::list<Adjacent>::iterator it=al.begin(); it != al.end(); it++)
         {
@@ -190,7 +180,6 @@
             adjLsaData+=boost::lexical_cast<std::string>((*it).getConnectingFace());
             adjLsaData+="|";
             adjLsaData+=boost::lexical_cast<std::string>((*it).getLinkCost());
-
         }
         return adjLsaData;
     }
@@ -203,7 +192,6 @@
         {
             pnlsr.getNpt().addNpte(getOrigRouter(), getOrigRouter(),pnlsr);
         }
-
     }
 
 
@@ -237,7 +225,6 @@
             os<<"      Connecting Face: "<<(*it).getConnectingFace()<<endl;
             os<<"      Link Cost: "<<(*it).getLinkCost()<<endl;
         }
-
         return os;
     }
 
diff --git a/src/nlsr_lsdb.cpp b/src/nlsr_lsdb.cpp
index dbe5b86..cd80809 100644
--- a/src/nlsr_lsdb.cpp
+++ b/src/nlsr_lsdb.cpp
@@ -31,7 +31,6 @@
                         , pnlsr.getNpl() );
         pnlsr.getSm().setNameLsaSeq(pnlsr.getSm().getNameLsaSeq()+1);
         return installNameLsa(pnlsr,nameLsa);
-
     }
 
     std::pair<NameLsa&, bool>
@@ -40,15 +39,12 @@
         std::list<NameLsa >::iterator it = std::find_if( nameLsdb.begin(),
                                            nameLsdb.end(),
                                            bind(nameLsaCompareByKey, _1, key));
-
         if( it != nameLsdb.end())
         {
             return std::make_pair(boost::ref((*it)),true);
         }
-
         NameLsa nlsa;
         return std::make_pair(boost::ref(nlsa),false);
-
     }
 
 
@@ -81,7 +77,6 @@
                     }
                 }
             }
-
             if(nlsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
             {
                 timeToExpire=nlsa.getLifeTime();
@@ -95,10 +90,8 @@
             {
                 chkNameLsa.first.setLsSeqNo(nlsa.getLsSeqNo());
                 chkNameLsa.first.setLifeTime(nlsa.getLifeTime());
-
                 chkNameLsa.first.getNpl().sortNpl();
                 nlsa.getNpl().sortNpl();
-
                 std::list<string> nameToAdd;
                 std::set_difference(nlsa.getNpl().getNameList().begin(),
                                     nlsa.getNpl().getNameList().end(),
@@ -117,7 +110,6 @@
                         }
                     }
                 }
-
                 std::list<string> nameToRemove;
                 std::set_difference(chkNameLsa.first.getNpl().getNameList().begin(),
                                     chkNameLsa.first.getNpl().getNameList().end(),
@@ -136,7 +128,6 @@
                         }
                     }
                 }
-
                 if(nlsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
                 {
                     timeToExpire=nlsa.getLifeTime();
@@ -147,7 +138,6 @@
                                                        nlsa.getNameLsaKey(), nlsa.getLsSeqNo(), timeToExpire));
             }
         }
-
         return true;
     }
 
@@ -156,7 +146,6 @@
     {
         std::list<NameLsa >::iterator it = std::find_if( nameLsdb.begin(),
                                            nameLsdb.end(), bind(nameLsaCompareByKey, _1, nlsa.getNameLsaKey()));
-
         if( it == nameLsdb.end())
         {
             nameLsdb.push_back(nlsa);
@@ -184,7 +173,6 @@
                         pnlsr.getNpt().removeNpte((*nit),(*it).getOrigRouter(),pnlsr);
                     }
                 }
-
             }
             nameLsdb.erase(it);
             return true;
@@ -198,12 +186,10 @@
         std::list<NameLsa >::iterator it = std::find_if( nameLsdb.begin(),
                                            nameLsdb.end(),
                                            bind(nameLsaCompareByKey, _1, key));
-
         if( it == nameLsdb.end())
         {
             return false;
         }
-
         return true;
     }
 
@@ -238,7 +224,6 @@
                       , pnlsr.getConfParameter().getCorTheta() );
         pnlsr.getSm().setCorLsaSeq(pnlsr.getSm().getCorLsaSeq()+1);
         installCorLsa(pnlsr, corLsa);
-
         return true;
     }
 
@@ -248,12 +233,10 @@
         std::list< CorLsa >::iterator it = std::find_if( corLsdb.begin(),
                                            corLsdb.end(),
                                            bind(corLsaCompareByKey, _1, key));
-
         if( it != corLsdb.end())
         {
             return std::make_pair(boost::ref((*it)), true);
         }
-
         CorLsa clsa;
         return std::make_pair(boost::ref(clsa),false);
     }
@@ -283,14 +266,12 @@
             {
                 pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
             }
-
             if(clsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
             {
                 timeToExpire=clsa.getLifeTime();
             }
             scheduleCorLsaExpiration(pnlsr,clsa.getCorLsaKey(),
                                      clsa.getLsSeqNo(), timeToExpire);
-
         }
         else
         {
@@ -302,14 +283,11 @@
                 {
                     chkCorLsa.first.setCorRadius(clsa.getCorRadius());
                     chkCorLsa.first.setCorTheta(clsa.getCorTheta());
-
                     if (pnlsr.getConfParameter().getIsHyperbolicCalc() >=1 )
                     {
                         pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
                     }
-
                 }
-
                 if(clsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
                 {
                     timeToExpire=clsa.getLifeTime();
@@ -320,9 +298,7 @@
                                                       clsa.getCorLsaKey(),
                                                       clsa.getLsSeqNo(), timeToExpire));
             }
-
         }
-
         return true;
     }
 
@@ -332,7 +308,6 @@
         std::list<CorLsa >::iterator it = std::find_if( corLsdb.begin(),
                                           corLsdb.end(),
                                           bind(corLsaCompareByKey, _1, clsa.getCorLsaKey()));
-
         if( it == corLsdb.end())
         {
             corLsdb.push_back(clsa);
@@ -357,7 +332,6 @@
             return true;
         }
         return false;
-
     }
 
     bool
@@ -366,12 +340,10 @@
         std::list<CorLsa >::iterator it = std::find_if( corLsdb.begin(),
                                           corLsdb.end(),
                                           bind(corLsaCompareByKey, _1, key));
-
         if( it == corLsdb.end())
         {
             return false;
         }
-
         return true;
     }
 
@@ -401,7 +373,6 @@
     {
         cout<<"scheduledAdjLsaBuild Called"<<endl;
         pnlsr.setIsBuildAdjLsaSheduled(0);
-
         if( pnlsr.getAdl().isAdjLsaBuildable(pnlsr))
         {
             int adjBuildCount=pnlsr.getAdjBuildCount();
@@ -429,7 +400,6 @@
                                                ndn::bind(&Lsdb::scheduledAdjLsaBuild, pnlsr.getLsdb(),
                                                        boost::ref(pnlsr)));
         }
-
     }
 
 
@@ -439,14 +409,12 @@
         std::list<AdjLsa >::iterator it = std::find_if( adjLsdb.begin(),
                                           adjLsdb.end(),
                                           bind(adjLsaCompareByKey, _1, alsa.getAdjLsaKey()));
-
         if( it == adjLsdb.end())
         {
             adjLsdb.push_back(alsa);
             return true;
         }
         return false;
-
     }
 
     std::pair<AdjLsa& , bool>
@@ -455,12 +423,10 @@
         std::list<AdjLsa >::iterator it = std::find_if( adjLsdb.begin(),
                                           adjLsdb.end(),
                                           bind(adjLsaCompareByKey, _1, key));
-
         if( it != adjLsdb.end())
         {
             return std::make_pair(boost::ref((*it)),true);
         }
-
         AdjLsa alsa;
         return std::make_pair(boost::ref(alsa),false);
     }
@@ -485,14 +451,12 @@
             addAdjLsa(alsa);
             alsa.addNptEntriesForAdjLsa(pnlsr);
             pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
-
             if(alsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
             {
                 timeToExpire=alsa.getLifeTime();
             }
             scheduleAdjLsaExpiration(pnlsr,alsa.getAdjLsaKey(),
                                      alsa.getLsSeqNo(),timeToExpire);
-
         }
         else
         {
@@ -500,14 +464,12 @@
             {
                 chkAdjLsa.first.setLsSeqNo(alsa.getLsSeqNo());
                 chkAdjLsa.first.setLifeTime(alsa.getLifeTime());
-
                 if ( !	chkAdjLsa.first.isLsaContentEqual(alsa))
                 {
                     chkAdjLsa.first.getAdl().resetAdl();
                     chkAdjLsa.first.getAdl().addAdjacentsFromAdl(alsa.getAdl());
                     pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
                 }
-
                 if(alsa.getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
                 {
                     timeToExpire=alsa.getLifeTime();
@@ -517,11 +479,8 @@
                 chkAdjLsa.first.setLsaExpiringEventId(scheduleAdjLsaExpiration(pnlsr,
                                                       alsa.getAdjLsaKey(), alsa.getLsSeqNo(),timeToExpire));
             }
-
         }
-
         printAdjLsdb();
-
         return true;
     }
 
@@ -551,7 +510,6 @@
             return true;
         }
         return false;
-
     }
 
     bool
@@ -560,12 +518,10 @@
         std::list< AdjLsa >::iterator it = std::find_if( adjLsdb.begin(),
                                            adjLsdb.end(),
                                            bind(adjLsaCompareByKey, _1, key));
-
         if( it == adjLsdb.end())
         {
             return false;
         }
-
         return true;
     }
 
@@ -637,7 +593,6 @@
                     cout<<"Other's Adj LSA, so removing form LSDB"<<endl;
                     removeAdjLsa(pnlsr, lsaKey);
                 }
-
                 // schedule Routing table calculaiton
                 pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
             }
@@ -667,7 +622,6 @@
                     cout<<"Other's Cor LSA, so removing form LSDB"<<endl;
                     removeCorLsa(pnlsr, lsaKey);
                 }
-
                 if (pnlsr.getConfParameter().getIsHyperbolicCalc() >=1 )
                 {
                     pnlsr.getRoutingTable().scheduleRoutingTableCalculation(pnlsr);
@@ -704,7 +658,6 @@
         {
             return doesCorLsaExist(key);
         }
-
         return false;
     }
 
diff --git a/src/nlsr_map.cpp b/src/nlsr_map.cpp
index b879889..47b02ec 100644
--- a/src/nlsr_map.cpp
+++ b/src/nlsr_map.cpp
@@ -17,7 +17,6 @@
     {
         os<<"MapEntry: ( Router: "<<mpe.getRouter()<<" Mapping No: ";
         os<<mpe.getMappingNumber()<<" )"<<endl;
-
         return os;
     }
 
@@ -100,7 +99,6 @@
                 string linkEndRouter=(*itAdl).getAdjacentName();
                 addMapElement(linkEndRouter);
             }
-
         }
     }
 
@@ -120,7 +118,6 @@
         {
             os<< (*it);
         }
-
         return os;
     }
 
diff --git a/src/nlsr_npl.cpp b/src/nlsr_npl.cpp
index 326b001..e8356cb 100644
--- a/src/nlsr_npl.cpp
+++ b/src/nlsr_npl.cpp
@@ -10,12 +10,10 @@
 
     Npl::Npl()
     {
-
     }
 
     Npl::~Npl()
     {
-
     }
 
     static bool
@@ -30,15 +28,12 @@
         std::list<string >::iterator it = std::find_if( nameList.begin(),
                                           nameList.end(),
                                           bind(&nameCompare, _1 , name));
-
         if( it != nameList.end() )
         {
             return -1;
         }
-
         nameList.push_back(name);
         return 0;
-
     }
 
     int
@@ -47,12 +42,10 @@
         std::list<string >::iterator it = std::find_if( nameList.begin(),
                                           nameList.end(),
                                           bind(&nameCompare, _1 , name));
-
         if( it != nameList.end() )
         {
             nameList.erase(it);
         }
-
         return -1;
     }
 
diff --git a/src/nlsr_npt.cpp b/src/nlsr_npt.cpp
index 5f4ea43..9c4d4cb 100644
--- a/src/nlsr_npt.cpp
+++ b/src/nlsr_npt.cpp
@@ -24,7 +24,6 @@
     {
         std::list<Npte >::iterator it = std::find_if( npteList.begin(),
                                         npteList.end(), bind(&npteCompare, _1, name));
-
         if ( it == npteList.end() )
         {
             Npte newEntry(	name);
@@ -53,7 +52,6 @@
         if ( it != npteList.end() )
         {
             string destRouter=rte.getDestination();
-
             (*it).removeRoutingTableEntry(rte);
             if ( ((*it).getRteListSize() == 0 ) &&
                     (!pnlsr.getLsdb().doesLsaExist(destRouter+"/1",1) ) &&
@@ -63,7 +61,6 @@
                 npteList.erase(it); // remove entry from NPT
                 // remove FIB entry with this name
                 pnlsr.getFib().removeFromFib(pnlsr,name);
-
             }
             else
             {
@@ -90,7 +87,6 @@
             RoutingTableEntry rte(destRouter);
             addNpte(name, rte,pnlsr);
         }
-
     }
 
     void
diff --git a/src/nlsr_npte.cpp b/src/nlsr_npte.cpp
index d2d1d8a..60013ff 100644
--- a/src/nlsr_npte.cpp
+++ b/src/nlsr_npte.cpp
@@ -77,7 +77,6 @@
             cout<<(*it);
         }
         os<<npte.getNhl();
-
         return os;
     }
 
diff --git a/src/nlsr_rt.cpp b/src/nlsr_rt.cpp
index 734a85e..87dcd26 100644
--- a/src/nlsr_rt.cpp
+++ b/src/nlsr_rt.cpp
@@ -19,11 +19,9 @@
     {
         //debugging purpose
         pnlsr.getNpt().printNpt();
-
         if ( 	pnlsr.getIsRoutingTableCalculating() == 0 )
         {
             pnlsr.setIsRoutingTableCalculating(1); //setting routing table calculation
-
             if ( pnlsr.getLsdb().doesLsaExist(
                         pnlsr.getConfParameter().getRouterPrefix()+"/"+"2",2) )
             {
@@ -48,7 +46,6 @@
                     {
                         calculateHypDryRoutingTable(pnlsr);
                     }
-
                     //need to update NPT here
                     pnlsr.getNpt().updateNptWithNewRoute(pnlsr);
                     //debugging purpose
@@ -77,8 +74,6 @@
                 pnlsr.getFib().printFib();
                 //debugging purpose end
             }
-
-
             pnlsr.setIsRouteCalculationScheduled(0); //clear scheduled flag
             pnlsr.setIsRoutingTableCalculating(0); //unsetting routing table calculation
         }
@@ -86,7 +81,6 @@
         {
             scheduleRoutingTableCalculation(pnlsr);
         }
-
     }
 
 
@@ -97,7 +91,6 @@
         Map vMap;
         vMap.createMapFromAdjLsdb(pnlsr);
         int numOfRouter=vMap.getMapSize();
-
         LinkStateRoutingTableCalculator lsrtc(numOfRouter);
         lsrtc.calculatePath(vMap,boost::ref(*this),pnlsr);
     }
@@ -199,7 +192,6 @@
         {
             (*it).getNhl().addNextHop(nh);
         }
-
     }
 
     void
diff --git a/src/nlsr_rtc.cpp b/src/nlsr_rtc.cpp
index e594794..acdf6d5 100644
--- a/src/nlsr_rtc.cpp
+++ b/src/nlsr_rtc.cpp
@@ -53,7 +53,6 @@
                     adjMatrix[row][col]=cost;
                 }
             }
-
         }
     }
 
@@ -163,7 +162,6 @@
         int noLink=getNumOfLinkfromAdjMatrix(sourceRouter);
         allocateParent();
         allocateDistance();
-
         if ( pnlsr.getConfParameter().getMaxFacesPerPrefix() == 1 )
         {
             // Single Path
@@ -179,11 +177,9 @@
             setNoLink(getNumOfLinkfromAdjMatrix(sourceRouter));
             allocateLinks();
             allocateLinkCosts();
-
             getLinksFromAdjMatrix(links, linkCosts, sourceRouter);
             for (int i=0 ; i < vNoLink; i++)
             {
-
                 adjustAdMatrix(sourceRouter,links[i], linkCosts[i]);
                 printAdjMatrix();
                 doDijkstraPathCalculation(sourceRouter);
@@ -192,11 +188,9 @@
                 //update routing table
                 addAllLsNextHopsToRoutingTable(pnlsr, rt, pMap, sourceRouter);
             }
-
             freeLinks();
             freeLinksCosts();
         }
-
         freeParent();
         freeDistance();
         freeAdjMatrix();
@@ -216,12 +210,10 @@
             distance[i]=INF_DISTANCE;
             Q[i]=i;
         }
-
         if ( sourceRouter != NO_MAPPING_NUM )
         {
             distance[sourceRouter]=0;
             sortQueueByDistance(Q,distance,head,numOfRouter);
-
             while (head < numOfRouter )
             {
                 u=Q[head];
@@ -229,7 +221,6 @@
                 {
                     break;
                 }
-
                 for(v=0 ; v <numOfRouter; v++)
                 {
                     if( adjMatrix[u][v] > 0 )
@@ -241,13 +232,9 @@
                                 distance[v]=distance[u] + adjMatrix[u][v] ;
                                 parent[v]=u;
                             }
-
                         }
-
                     }
-
                 }
-
                 head++;
                 sortQueueByDistance(Q,distance,head,numOfRouter);
             }
@@ -278,7 +265,6 @@
                 // Add next hop to routing table
                 NextHop nh(nxtHopFace,routeCost);
                 rt.addNextHop(pMap.getRouterNameByMappingNo(i),nh);
-
             }
         }
     }
@@ -291,14 +277,11 @@
         {
             nextHop=dest;
             dest=parent[dest];
-
         }
-
         if ( dest != source )
         {
             nextHop=NO_NEXT_HOP;
         }
-
         return nextHop;
     }
 
@@ -324,7 +307,6 @@
         {
             printLsPath(parent[destRouter]);
         }
-
         cout<<" "<<destRouter;
     }
 
@@ -344,7 +326,6 @@
                 }
             }
         }
-
     }
 
     int
@@ -399,9 +380,7 @@
         setNoLink(noLink);
         allocateLinks();
         allocateLinkCosts();
-
         getLinksFromAdjMatrix(links, linkCosts, sourceRouter);
-
         for(int i=0 ; i < numOfRouter ; ++i)
         {
             int k=0;
@@ -410,7 +389,6 @@
                 allocateLinkFaces();
                 allocateDistanceToNeighbor();
                 allocateDistFromNbrToDest();
-
                 for(int j=0; j<vNoLink; j++)
                 {
                     string nextHopRouterName=pMap.getRouterNameByMappingNo(links[j]);
@@ -428,15 +406,12 @@
                         k++;
                     }
                 }
-
                 addHypNextHopsToRoutingTable(pnlsr,pMap,rt,k,i);
-
                 freeLinkFaces();
                 freeDistanceToNeighbor();
                 freeDistFromNbrToDest();
             }
         }
-
         freeLinks();
         freeLinksCosts();
         freeAdjMatrix();
@@ -456,7 +431,6 @@
                 rt.addNextHopToDryTable(destRouter,nh);
             }
         }
-
     }
 
     double
@@ -464,25 +438,18 @@
             Map& pMap, int src, int dest)
     {
         double distance=0.0;
-
         string srcRouterKey=pMap.getRouterNameByMappingNo(src)+"/3";
         string destRouterKey=pMap.getRouterNameByMappingNo(dest)+"/3";
-
         double srcRadius=(pnlsr.getLsdb().getCorLsa(srcRouterKey).first).getCorRadius();
         double srcTheta=(pnlsr.getLsdb().getCorLsa(srcRouterKey).first).getCorTheta();
-
         double destRadius=(pnlsr.getLsdb().getCorLsa(
                                destRouterKey).first).getCorRadius();
         double destTheta=(pnlsr.getLsdb().getCorLsa(destRouterKey).first).getCorTheta();
-
-
         double diffTheta = fabs (srcTheta - destTheta);
-
         if (diffTheta > MATH_PI)
         {
             diffTheta = 2 * MATH_PI - diffTheta;
         }
-
         if ( srcRadius != -1 && destRadius != -1 )
         {
             if (diffTheta == 0)
@@ -495,7 +462,6 @@
         {
             distance = -1;
         }
-
         return distance;
     }
 
diff --git a/src/nlsr_rte.hpp b/src/nlsr_rte.hpp
index 25bc7ce..27d3601 100644
--- a/src/nlsr_rte.hpp
+++ b/src/nlsr_rte.hpp
@@ -17,7 +17,6 @@
             : destination()
             , nhl()
         {
-
         }
 
         ~RoutingTableEntry()
diff --git a/src/nlsr_test.cpp b/src/nlsr_test.cpp
index f7d8d13..c04fd77 100644
--- a/src/nlsr_test.cpp
+++ b/src/nlsr_test.cpp
@@ -15,7 +15,6 @@
     NlsrTest::schedlueAddingLsas(Nlsr& pnlsr)
     {
         // scheduling adding two name lsas, two Cor Lsas and three Adj LSAs
-
         //Scheduling Adding LSAs for router altair
         string router("/ndn/memphis.edu/cs/altair");
         string name1("/ndn/memphis.edu/cs/altair/name1");
@@ -23,7 +22,6 @@
         string name3("/ndn/memphis.edu/cs/broadcast");
         Adjacent adj1("/ndn/memphis.edu/cs/pollux",7,17,1,0);
         Adjacent adj2("/ndn/memphis.edu/cs/maia",15,27,1,0);
-
         pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(30),
                                            ndn::bind(&NlsrTest::secheduledAddNameLsa,pnlsr.getNlsrTesting(),
                                                    boost::ref(pnlsr)
@@ -36,7 +34,6 @@
                                            ndn::bind(&NlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
                                                    boost::ref(pnlsr)
                                                    ,router,adj1,adj2));
-
         //Scheduling Adding LSAs for router Maia
         string routerMaia("/ndn/memphis.edu/cs/maia");
         string maiaName1("/ndn/memphis.edu/maia/name1");
@@ -44,7 +41,6 @@
         string maiaName3("/ndn/memphis.edu/cs/broadcast");
         Adjacent maiaAdj1("/ndn/memphis.edu/cs/pollux",8,25,1,0);
         Adjacent maiaAdj2("/ndn/memphis.edu/cs/altair",11,15,1,0);
-
         pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(55),
                                            ndn::bind(&NlsrTest::secheduledAddNameLsa,pnlsr.getNlsrTesting(),
                                                    boost::ref(pnlsr)
@@ -57,18 +53,14 @@
                                            ndn::bind(&NlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
                                                    boost::ref(pnlsr)
                                                    ,routerMaia,maiaAdj1,maiaAdj2));
-
         //sheduling Adding LSAs for Router itself
         string routerPollux("/ndn/memphis.edu/cs/pollux");
         Adjacent polluxAdj1("/ndn/memphis.edu/cs/maia",9,13,1,0);
         Adjacent polluxAdj2("/ndn/memphis.edu/cs/altair",12,23,1,0);
-
         pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(90),
                                            ndn::bind(&NlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
                                                    boost::ref(pnlsr)
                                                    ,routerPollux,polluxAdj1,polluxAdj2));
-
-
     }
 
 
@@ -83,7 +75,6 @@
         npl.insertIntoNpl(name3);
         NameLsa nameLsa(router,1,1,3600,npl);
         pnlsr.getLsdb().installNameLsa(pnlsr, nameLsa);
-
     }
 
     void
@@ -102,7 +93,6 @@
         adl.insert(adj2);
         AdjLsa adjLsa(router,2,1,3600,2,adl);
         pnlsr.getLsdb().installAdjLsa(pnlsr, adjLsa);
-
     }
 
 }//namespace nlsr
diff --git a/src/nlsr_tokenizer.cpp b/src/nlsr_tokenizer.cpp
index 3c49f8c..d64a600 100644
--- a/src/nlsr_tokenizer.cpp
+++ b/src/nlsr_tokenizer.cpp
@@ -18,11 +18,9 @@
         char_separator<char> sep(seps.c_str());
         tokenizer< char_separator<char> >tokens(originalString, sep);
         tokenizer< char_separator<char> >::iterator tok_iter = tokens.begin();
-
         string ft(*tok_iter);
         firstToken=ft;
         ++tok_iter;
-
         for ( ; tok_iter != tokens.end(); ++tok_iter)
         {
             string oneToken(*tok_iter);
@@ -30,7 +28,6 @@
             restOfTheLine+=oneToken;
             restOfTheLine+=seps;
         }
-
         trim(restOfTheLine);
     }
 
@@ -45,7 +42,6 @@
     {
         int pos=-1;
         int i=1;
-
         for(std::list<string>::iterator it=tokenList.begin(); it!=tokenList.end(); it++)
         {
             if( (*it) == token )
@@ -54,12 +50,10 @@
             }
             i++;
         }
-
         if( i < tokenList.size() )
         {
             pos=i;
         }
-
         return pos;
     }
 
@@ -79,12 +73,9 @@
                     string oneToken((*it));
                     returnString+=seps;
                     returnString+=oneToken;
-
                 }
-
             }
         }
-
         trim(returnString);
         return returnString;
     }
@@ -105,12 +96,9 @@
                     string oneToken((*it));
                     returnString+=seps;
                     returnString+=oneToken;
-
                 }
-
             }
         }
-
         trim(returnString);
         return returnString;
     }
@@ -127,12 +115,10 @@
         std::list<string >::iterator it = std::find_if( tokenList.begin(),
                                           tokenList.end(),
                                           bind(&tokenCompare, _1 , token));
-
         if( it != tokenList.end() )
         {
             return true;
         }
-
         return false;
     }
 
