diff --git a/src/route/nlsr_fe.cpp b/src/route/nlsr_fe.cpp
index 5f4811c..9464f63 100644
--- a/src/route/nlsr_fe.cpp
+++ b/src/route/nlsr_fe.cpp
@@ -5,44 +5,44 @@
 namespace nlsr
 {
 
-    using namespace std;
+  using namespace std;
 
-    bool
-    FibEntry::isEqualNextHops(Nhl &nhlOther)
+  bool
+  FibEntry::isEqualNextHops(Nhl &nhlOther)
+  {
+    if ( nhl.getNhlSize() != nhlOther.getNhlSize() )
     {
-        if ( nhl.getNhlSize() != nhlOther.getNhlSize() )
+      return false;
+    }
+    else
+    {
+      int nhCount=0;
+      std::list<NextHop>::iterator it1, it2;
+      for ( it1=nhl.getNextHopList().begin(),
+            it2 = nhlOther.getNextHopList().begin() ;
+            it1 != nhl.getNextHopList().end() ; it1++, it2++)
+      {
+        if (it1->getConnectingFace() == it2->getConnectingFace() )
         {
-            return false;
+          it1->setRouteCost(it2->getRouteCost());
+          nhCount++;
         }
         else
         {
-            int nhCount=0;
-            std::list<NextHop>::iterator it1, it2;
-            for ( it1=nhl.getNextHopList().begin(),
-                    it2 = nhlOther.getNextHopList().begin() ;
-                    it1 != nhl.getNextHopList().end() ; it1++, it2++)
-            {
-                if ((*it1).getConnectingFace() == (*it2).getConnectingFace() )
-                {
-                    (*it1).setRouteCost((*it2).getRouteCost());
-                    nhCount++;
-                }
-                else
-                {
-                    break;
-                }
-            }
-            return nhCount == nhl.getNhlSize();
+          break;
         }
+      }
+      return nhCount == nhl.getNhlSize();
     }
+  }
 
-    ostream&
-    operator<<(ostream& os, FibEntry& fe)
-    {
-        os<<"Name Prefix: "<<fe.getName()<<endl;
-        os<<"Time to Refresh: "<<fe.getTimeToRefresh()<<endl;
-        os<<fe.getNhl()<<endl;
-        return os;
-    }
+  ostream&
+  operator<<(ostream& os, FibEntry fe)
+  {
+    os<<"Name Prefix: "<<fe.getName()<<endl;
+    os<<"Time to Refresh: "<<fe.getTimeToRefresh()<<endl;
+    os<<fe.getNhl()<<endl;
+    return os;
+  }
 
 }//namespace nlsr
