diff --git a/examples/ccnx-grid.cc b/examples/ccnx-grid.cc
new file mode 100644
index 0000000..239654e
--- /dev/null
+++ b/examples/ccnx-grid.cc
@@ -0,0 +1,147 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
+ */
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/point-to-point-module.h"
+#include "ns3/NDNabstraction-module.h"
+#include <ns3/point-to-point-grid.h>
+#include "ns3/ipv4-global-routing-helper.h"
+
+#include <iostream>
+#include <sstream>
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("CcnxGrid");
+
+int 
+main (int argc, char *argv[])
+{
+    uint32_t n = 3;
+    
+    Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("10Mbps"));
+    Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("1ms"));
+    
+    Packet::EnableChecking();
+    Packet::EnablePrinting();
+    CommandLine cmd;
+    cmd.Parse (argc, argv);
+
+    PointToPointHelper p2p;
+    InternetStackHelper stack;
+    
+    Ipv4GlobalRoutingHelper ipv4RoutingHelper;
+    // Ptr<Ipv4RoutingHelper> ipv4RoutingHelper = stack.GetRoutingHelper ();
+    stack.SetRoutingHelper (ipv4RoutingHelper);
+    
+    PointToPointGridHelper grid (n, n, p2p);
+    grid.InstallStack (stack);
+    
+    // // Create router nodes, initialize routing database and set up the routing
+    // // tables in the nodes.
+    Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
+    
+    grid.AssignIpv4Addresses (
+                              Ipv4AddressHelper("10.1.0.0", "255.255.255.0"),
+                              Ipv4AddressHelper("10.2.0.0", "255.255.255.0")
+                              );
+    
+    NS_LOG_INFO ("Installing NDN stack");
+    NodeContainer c;
+    
+    for(uint32_t i=0; i<n; i++)
+    {
+        for(uint32_t j=0; j<n; j++)
+        {
+            NS_LOG_INFO ("Adding node i="<<i << " j=" << j);
+            c.Add(grid.GetNode(i,j));
+            
+            int nodeCount = i*n+j+1;
+            std::stringstream ss;
+            ss<<nodeCount;
+            Names::Add (ss.str(), c.Get (c.GetN()-1));
+            NS_LOG_INFO("Eventual name is " << ss.str());
+        }
+    }
+    CcnxStackHelper ccnx;
+    Ptr<CcnxFaceContainer> cf = ccnx.Install (c);
+
+    NS_LOG_INFO ("Installing Applications");
+    CcnxConsumerHelper helper ("/3");
+    ApplicationContainer app = helper.Install ("1");
+    app.Start (Seconds (1.0));
+    app.Stop (Seconds (10.05));
+    
+    CcnxProducerHelper helper2 ("/3",120);
+    ApplicationContainer app2 = helper2.Install("9");
+    app2.Start(Seconds(0.0));
+    app2.Stop(Seconds(15.0));
+    
+    /**
+     * \brief Add forwarding entry in FIB
+     *
+     * \param node Node
+     * \param prefix Routing prefix
+     * \param face Face index
+     * \param metric Routing metric
+     */
+    
+    //2x2 works
+    /*ccnx.AddRoute ("1", "/3", 0, 1);
+    ccnx.AddRoute ("1", "/3", 1, 1);
+    
+    ccnx.AddRoute ("2", "/3", 1, 1);
+    ccnx.AddRoute ("3", "/3", 1, 1);
+    */
+    
+    //3x3
+    
+    ccnx.AddRoute ("1", "/3", 0, 1);
+    ccnx.AddRoute ("1", "/3", 1, 1);
+    
+    ccnx.AddRoute ("2", "/3", 1, 1);
+    
+    ccnx.AddRoute ("3", "/3", 1, 1);
+    
+    ccnx.AddRoute ("4", "/3", 2, 1);
+    
+    ccnx.AddRoute ("6", "/3", 2, 1);
+    
+    ccnx.AddRoute ("7", "/3", 1, 1);
+    
+    ccnx.AddRoute ("8", "/3", 1, 1);
+    
+    
+    NS_LOG_INFO ("FIB dump:\n" << *c.Get(0)->GetObject<CcnxFib> ());
+    NS_LOG_INFO ("FIB dump:\n" << *c.Get(1)->GetObject<CcnxFib> ());
+    
+    
+    
+    Simulator::Stop (Seconds (20));
+    
+    NS_LOG_INFO ("Run Simulation.");
+    Simulator::Run ();
+    Simulator::Destroy ();
+    NS_LOG_INFO ("Done.");
+    
+    return 0;
+
+}
\ No newline at end of file
diff --git a/helper/ccnx-stack-helper.cc b/helper/ccnx-stack-helper.cc
index 6ea2883..0a39a80 100644
--- a/helper/ccnx-stack-helper.cc
+++ b/helper/ccnx-stack-helper.cc
@@ -194,40 +194,38 @@
   node->AggregateObject (ccnx);
 
   Ptr<CcnxPit> pit = ccnx->GetPit();
-    
+    NS_LOG_INFO("NODE #"<<node->GetNDevices());
   for (uint32_t index=0; index < node->GetNDevices (); index++)
     {
+        Ptr<PointToPointNetDevice> device = DynamicCast<PointToPointNetDevice>(node->GetDevice(index));
+        if(device == 0)
+            continue;
+        
       Ptr<CcnxNetDeviceFace> face = Create<CcnxNetDeviceFace> (node->GetDevice (index));
       face->SetNode (node);
       uint32_t __attribute__ ((unused)) face_id = ccnx->AddFace (face);
       NS_LOG_LOGIC ("Node " << node->GetId () << ": added CcnxNetDeviceFace as face #" << face_id);
-
       // Setup bucket filtering
       // Assume that we know average data packet size, and this size is equal default size
       // Set maximum buckets (averaging over 1 second)
-      Ptr<PointToPointNetDevice> device = node->GetDevice(index)->GetObject<PointToPointNetDevice> ();
+      
       DataRateValue dataRate;
       device->GetAttribute ("DataRate", dataRate);
-      pit->maxBucketsPerFace[face->GetId()] = 0.1 * dataRate.Get().GetBitRate () / 8 / (NDN_DEFAULT_DATA_SIZE + sizeof(CcnxInterestHeader)); 
+      NS_LOG_INFO("DataRate for this link is " << dataRate.Get());
+      pit->maxBucketsPerFace[face->GetId()] = 0.1 * dataRate.Get().GetBitRate () / 8 /(NDN_DEFAULT_DATA_SIZE + sizeof(CcnxInterestHeader));
+      NS_LOG_INFO("maxBucketsPerFace["<<face->GetId()<<"] = " << pit->maxBucketsPerFace[face->GetId()]); 
       pit->leakSize[face->GetId()] = 0.97 * NDN_INTEREST_RESET_PERIOD / SECOND * dataRate.Get().GetBitRate () / 8 / (NDN_DEFAULT_DATA_SIZE + sizeof(CcnxInterestHeader));
-      
-    
+      NS_LOG_INFO("pit->leakSize["<<face->GetId()<<"] = " << pit->leakSize[face->GetId()]);
+        
+        
+      if(face->IsLocal()==true)
+        NS_LOG_INFO("Face #" << face_id << " is turned on");
       face->SetUp ();
       faces->Add (face);
     }
     
-/*    
-    // Assume that we know average data packet size, and this size is equal default size
-    // Set maximum buckets (averaging over 1 second)
-    _pit.maxBucketsPerInterface[*it] = 0.1*_node->macData[*it]->bandwidth / 8 / (NDN_DEFAULT_DATA_SIZE+sizeof(NdnPacket));
-    _pit.leakSize[*it] = 0.97 * NDN_INTEREST_RESET_PERIOD / SECOND * _node->macData[*it]->bandwidth/8 / (NDN_DEFAULT_DATA_SIZE+sizeof(NdnPacket));
-
-  */  
-    m_forwardingHelper.SetForwarding (ccnx, pit);
+  m_forwardingHelper.SetForwarding (ccnx, pit);
   
-    // Ptr<CcnxForwardingStrategy> ccnxForwarding = m_forwarding->Create (node);
-  // ccnx->SetForwardingStrategy (ccnxForwarding);
-
   return faces;
 }
 
@@ -256,8 +254,25 @@
   prefixValue.DeserializeFromString (prefix, MakeCcnxNameComponentsChecker ());
   fib->Add (prefixValue.Get (), face, metric);
 }
-
-
+/*
+void
+CcnxStackHelper::AddRoute (Ptr<Node> node, std::string prefix, uint32_t faceId, int32_t metric)
+{
+    NS_LOG_LOGIC ("[" << nodeName << "]$ route add " << prefix << " via " << faceId << " metric " << metric);
+    
+  NS_ASSERT_MSG (node != 0, "Node does not exist");
+        
+  Ptr<Ccnx>     ccnx = node->GetObject<Ccnx> ();
+  Ptr<CcnxFib>  fib  = node->GetObject<CcnxFib> ();
+  Ptr<CcnxFace> face = ccnx->GetFace (faceId);
+  NS_ASSERT_MSG (node != 0, "Face with ID [" << faceId << "] does not exist on node [" << nodeName << "]");
+        
+  CcnxNameComponentsValue prefixValue;
+  prefixValue.DeserializeFromString (prefix, MakeCcnxNameComponentsChecker ());
+  fib->Add (prefixValue.Get (), face, metric);
+}
+*/
+    
 static void
 CcnxL3ProtocolRxTxSink (Ptr<const Packet> p, Ptr<Ccnx> ccnx, uint32_t face)
 {
diff --git a/helper/ccnx-stack-helper.h b/helper/ccnx-stack-helper.h
index a728860..eebbf0b 100644
--- a/helper/ccnx-stack-helper.h
+++ b/helper/ccnx-stack-helper.h
@@ -153,7 +153,10 @@
    */
   void
   AddRoute (std::string nodeName, std::string prefix, uint32_t faceId, int32_t metric);
-
+/*
+  void
+  AddRoute (Ptr<Node> node, std::string prefix, uint32_t faceId, int32_t metric);
+  */  
 private:
    CcnxForwardingHelper m_forwardingHelper;
     
diff --git a/model/ccnx-l3-protocol.cc b/model/ccnx-l3-protocol.cc
index e5f7f0c..4b832a4 100644
--- a/model/ccnx-l3-protocol.cc
+++ b/model/ccnx-l3-protocol.cc
@@ -279,11 +279,16 @@
   if ((header->IsNack()) && (pitEntry != m_pit->end ()))
     {
       //m_pit->erase (pitEntry);
+        NS_LOG_INFO("TRUE");
         m_pit->modify(pitEntry, CcnxPitEntry::DeleteIncoming(incomingFace));
     }
     
     NS_LOG_INFO("Before WasRecentlySatisfied");
-  if (m_rit->WasRecentlySatisfied (*header))
+    if (m_rit->WasRecentlySatisfied (*header))
+    {
+        return;
+    }
+  /*if (m_rit->WasRecentlySatisfied (*header))
     {
         NS_LOG_INFO("Entering WasRecentlySatisfied");
       // duplicate interests (same nonce) from applications are just ignored
@@ -300,11 +305,12 @@
                                m_node->GetObject<Ccnx> (), incomingFace);
         
       bool isMine = false;
-      TypeId tid = TypeId ("ns3::CcnxProducer");
+      //TypeId tid = TypeId ("ns3::CcnxProducer");
       for(uint32_t i=0; i<m_node->GetNApplications();i++)
         {
             Ptr<Application> app = m_node->GetApplication(i);
-            if(app->GetTypeId() == tid)
+            NS_LOG_INFO("ApplicationName = " << app->GetTypeId().GetName());
+            if(app->GetTypeId().GetName() == "ns3::CcnxProducer")
               {
                 if((DynamicCast<CcnxProducer>(app))->GetPrefix () == header->GetName ())
                 {
@@ -423,7 +429,7 @@
         
       if(pitEntry->m_fibEntry.m_faces.size() == 0)  
         return;
-    }
+    }*/
     
   // Otherwise,
   // propagate the interest
diff --git a/wscript b/wscript
index f462373..bd94d0f 100644
--- a/wscript
+++ b/wscript
@@ -61,6 +61,8 @@
         obj = bld.create_ns3_program('ccnx-routing-simple', ['NDNabstraction', 'point-to-point-layout'])
         obj.source = 'examples/ccnx-routing-simple.cc'
         
+        obj = bld.create_ns3_program('ccnx-grid', ['NDNabstraction', 'point-to-point-layout'])
+        obj.source = 'examples/ccnx-grid.cc'
 
     #     for path in ["examples"]:
     #         anode = bld.path.find_dir (path)
