diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 7a8572d..0822d38 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -99,6 +99,7 @@
 NexthopList::writeLog()
 {
   int i = 1;
+  sort();
   for (std::list<NextHop>::iterator it = m_nexthopList.begin();
        it != m_nexthopList.end() ; it++, i++) {
     _LOG_DEBUG("Nexthop " << i << ": " << (*it).getConnectingFaceUri()
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index 57bf6b2..00db7b7 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -167,7 +167,6 @@
   allocateAdjMatrix();
   initMatrix();
   makeAdjMatrix(pnlsr, pMap);
-  //printAdjMatrix();
   writeAdjMatrixLog();
   int sourceRouter = pMap.getMappingNoByRouterName(pnlsr.getConfParameter().getRouterPrefix());
   allocateParent();
@@ -332,8 +331,9 @@
 HypRoutingTableCalculator::calculatePath(Map& pMap,
                                          RoutingTable& rt, Nlsr& pnlsr)
 {
+  allocateAdjMatrix();
+  initMatrix();
   makeAdjMatrix(pnlsr, pMap);
-  //std::cout << pMap;
   ndn::Name routerName = pnlsr.getConfParameter().getRouterPrefix();
   int sourceRouter = pMap.getMappingNoByRouterName(routerName);
   int noLink = getNumOfLinkfromAdjMatrix(sourceRouter);
@@ -344,26 +344,23 @@
   for (int i = 0 ; i < numOfRouter ; ++i) {
     int k = 0;
     if (i != sourceRouter) {
-      allocateLinkFaces();
+      allocateNexthopRouters();
       allocateDistanceToNeighbor();
       allocateDistFromNbrToDest();
       for (int j = 0; j < vNoLink; j++) {
-        ndn::Name nextHopRouterName = pMap.getRouterNameByMappingNo(links[j]);
-        std::string nextHopFaceUri =
-          pnlsr.getAdjacencyList().getAdjacent(nextHopRouterName).getConnectingFaceUri();
         double distToNbr = getHyperbolicDistance(pnlsr, pMap,
                                                  sourceRouter, links[j]);
         double distToDestFromNbr = getHyperbolicDistance(pnlsr,
                                                          pMap, links[j], i);
         if (distToDestFromNbr >= 0) {
-          m_linkFaceUris[k] = nextHopFaceUri;
+          m_nexthopRouters[k] = links[j];
           m_distanceToNeighbor[k] = distToNbr;
           m_distFromNbrToDest[k] = distToDestFromNbr;
           k++;
         }
       }
       addHypNextHopsToRoutingTable(pnlsr, pMap, rt, k, i);
-      freeLinkFaces();
+      freeNexthopRouters();
       freeDistanceToNeighbor();
       freeDistFromNbrToDest();
     }
@@ -377,13 +374,18 @@
 HypRoutingTableCalculator::addHypNextHopsToRoutingTable(Nlsr& pnlsr, Map& pMap,
                                                         RoutingTable& rt, int noFaces, int dest)
 {
+  ndn::Name destRouter = pMap.getRouterNameByMappingNo(dest);
   for (int i = 0 ; i < noFaces ; ++i) {
-    ndn::Name destRouter = pMap.getRouterNameByMappingNo(dest);
-    NextHop nh(m_linkFaceUris[i], m_distFromNbrToDest[i]);
-    rt.addNextHop(destRouter, nh);
+    ndn::Name nextHopRouterName = pMap.getRouterNameByMappingNo(m_nexthopRouters[i]);
+    std::string nextHopFaceUri =
+         pnlsr.getAdjacencyList().getAdjacent(nextHopRouterName).getConnectingFaceUri();
+    NextHop nh(nextHopFaceUri, m_distFromNbrToDest[i]);
     if (m_isDryRun) {
       rt.addNextHopToDryTable(destRouter, nh);
     }
+    else {
+      rt.addNextHop(destRouter, nh);
+    }
   }
 }
 
@@ -396,14 +398,18 @@
   srcRouterKey.append("coordinate");
   ndn::Name destRouterKey = pMap.getRouterNameByMappingNo(dest);
   destRouterKey.append("coordinate");
-  double srcRadius = (pnlsr.getLsdb().findCoordinateLsa(
-                        srcRouterKey))->getCorRadius();
-  double srcTheta = (pnlsr.getLsdb().findCoordinateLsa(
-                       srcRouterKey))->getCorTheta();
-  double destRadius = (pnlsr.getLsdb().findCoordinateLsa(
-                         destRouterKey))->getCorRadius();
-  double destTheta = (pnlsr.getLsdb().findCoordinateLsa(
-                        destRouterKey))->getCorTheta();
+  CoordinateLsa* srcLsa = pnlsr.getLsdb().findCoordinateLsa(srcRouterKey);
+  CoordinateLsa* destLsa = pnlsr.getLsdb().findCoordinateLsa(destRouterKey);
+
+  if ((srcLsa == 0) || (destLsa == 0)) {
+    return -1;
+  }
+
+  double srcRadius = srcLsa->getCorRadius();
+  double srcTheta = srcLsa->getCorTheta();
+  double destRadius = destLsa->getCorRadius();
+  double destTheta = destLsa->getCorTheta();
+
   double diffTheta = fabs(srcTheta - destTheta);
   if (diffTheta > MATH_PI) {
     diffTheta = 2 * MATH_PI - diffTheta;
@@ -424,9 +430,9 @@
 }
 
 void
-HypRoutingTableCalculator::allocateLinkFaces()
+HypRoutingTableCalculator::allocateNexthopRouters()
 {
-  m_linkFaceUris.reserve(vNoLink);
+  m_nexthopRouters = new uint32_t[vNoLink];
 }
 
 void
@@ -442,9 +448,9 @@
 }
 
 void
-HypRoutingTableCalculator::freeLinkFaces()
+HypRoutingTableCalculator::freeNexthopRouters()
 {
-  m_linkFaceUris.clear();
+  delete [] m_nexthopRouters;
 }
 
 void
diff --git a/src/route/routing-table-calculator.hpp b/src/route/routing-table-calculator.hpp
index 3f1b53f..a56fed3 100644
--- a/src/route/routing-table-calculator.hpp
+++ b/src/route/routing-table-calculator.hpp
@@ -181,7 +181,7 @@
 
 private:
   void
-  allocateLinkFaces();
+  allocateNexthopRouters();
 
   void
   allocateDistanceToNeighbor();
@@ -190,7 +190,7 @@
   allocateDistFromNbrToDest();
 
   void
-  freeLinkFaces();
+  freeNexthopRouters();
 
   void
   freeDistanceToNeighbor();
@@ -208,7 +208,7 @@
 private:
   bool m_isDryRun;
 
-  std::vector<std::string> m_linkFaceUris;
+  uint32_t* m_nexthopRouters;
   double* m_distanceToNeighbor;
   double* m_distFromNbrToDest;
 
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 613371f..7ab5b8e 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -73,7 +73,7 @@
         //need to update NPT here
         _LOG_DEBUG("Calling Update NPT With new Route");
         pnlsr.getNamePrefixTable().updateWithNewRoute();
-        writeLog();
+        writeLog(pnlsr.getConfParameter().getHyperbolicState());
         pnlsr.getNamePrefixTable().writeLog();
         pnlsr.getFib().writeLog();
       }
@@ -90,7 +90,7 @@
       // need to update NPT here
       _LOG_DEBUG("Calling Update NPT With new Route");
       pnlsr.getNamePrefixTable().updateWithNewRoute();
-      writeLog();
+      writeLog(pnlsr.getConfParameter().getHyperbolicState());
       pnlsr.getNamePrefixTable().writeLog();
       pnlsr.getFib().writeLog();
       //debugging purpose end
@@ -184,7 +184,7 @@
 }
 
 void
-RoutingTable::writeLog()
+RoutingTable::writeLog(int hyperbolicState)
 {
   _LOG_DEBUG("---------------Routing Table------------------");
   for (std::list<RoutingTableEntry>::iterator it = m_rTable.begin() ;
@@ -193,6 +193,16 @@
     _LOG_DEBUG("Nexthops: ");
     (*it).getNexthopList().writeLog();
   }
+
+  if (hyperbolicState == HYPERBOLIC_STATE_DRY_RUN) {
+    _LOG_DEBUG("--------Hyperbolic Routing Table(Dry)---------");
+    for (std::list<RoutingTableEntry>::iterator it = m_dryTable.begin() ;
+        it != m_dryTable.end(); ++it) {
+      _LOG_DEBUG("Destination: " << (*it).getDestination());
+      _LOG_DEBUG("Nexthops: ");
+      (*it).getNexthopList().writeLog();
+    }
+  }
 }
 
 //function related to manipulation of dry routing table
diff --git a/src/route/routing-table.hpp b/src/route/routing-table.hpp
index 952a07e..3a3c96a 100644
--- a/src/route/routing-table.hpp
+++ b/src/route/routing-table.hpp
@@ -80,7 +80,7 @@
   clearDryRoutingTable();
 
   void
-  writeLog();
+  writeLog(int hyperbolicState);
 
   const int m_NO_NEXT_HOP;
 
