diff --git a/examples/base-experiment.h b/examples/base-experiment.h
index fd8c1f0..c77760d 100644
--- a/examples/base-experiment.h
+++ b/examples/base-experiment.h
@@ -87,6 +87,8 @@
         // // Populate FIB based on IPv4 global routing controller
         ccnxHelper.InstallRoutesToAll ();
       }
+    
+    reader->ApplyOspfMetric ();
   }
   
   void InstallIpStack ()
@@ -94,6 +96,7 @@
     InternetStackHelper stack;
     stack.Install (reader->GetNodes ());
     reader->AssignIpv4Addresses (Ipv4Address ("10.0.0.0"));
+    reader->ApplyOspfMetric ();
 
     Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
   }
@@ -132,6 +135,29 @@
   }
 
   void
+  SetPair (uint32_t pairId)
+  {
+    m_pairs.clear ();
+    m_usedNodes.clear ();
+
+    uint32_t i = 0;
+    for (uint32_t node1_num = 0; node1_num < 52; node1_num++)
+      for (uint32_t node2_num = 0; node2_num < 52; node2_num++)
+        {
+          if (node1_num == node2_num) continue;
+
+          // std::cout << "i = " << i << ", pairId = " << pairId << "\n";
+          if (i++ != pairId) continue;
+          
+          m_usedNodes.insert (node1_num);
+          m_usedNodes.insert (node2_num);
+
+          m_pairs.push_back (make_tuple (node1_num, node2_num));
+          return;
+        }
+  }
+
+  void
   Run (const Time &finishTime)
   {
     cout << "Run Simulation.\n";
diff --git a/examples/blackhole-sprint.cc b/examples/blackhole-sprint.cc
index 3901d70..d4884d5 100644
--- a/examples/blackhole-sprint.cc
+++ b/examples/blackhole-sprint.cc
@@ -240,6 +240,19 @@
     return d[destinationNode];
   }
 
+  // hijacker is more than an application. just disable all faces
+  static void
+  InstallHijacker (std::string prefix, Ptr<Node> node)
+  {
+    Ptr<Ccnx> ccnx = node->GetObject<Ccnx> ();
+    for (uint32_t i = 0; i < ccnx->GetNFaces (); i++)
+      {
+        Ptr<CcnxFace> face = ccnx->GetFace (i);
+        face->SetUp (false);
+      }
+    CcnxStackHelper::InstallRouteTo (prefix, node);
+  }
+
   //We are creating 10 pairs of producer-hijacker and everybody else is a consumer
   ApplicationContainer
   AddApplications ()
@@ -271,23 +284,12 @@
         apps.Add
           (legitimateProducerHelper.Install (node1));
         
-        CcnxAppHelper fakeProducerHelper ("ns3::CcnxHijacker");
-        fakeProducerHelper.SetPrefix (prefix);
-        ApplicationContainer hijacker = fakeProducerHelper.Install (node2);
-        apps.Add (hijacker);
-        hijacker.Start (Seconds(1.0));
-        
         // one more trick. Need to install route to hijacker (aka "hijacker announces itself as a legitimate producer")
         CcnxStackHelper::InstallRouteTo (prefix, node1);
-        Simulator::Schedule (Seconds(1.0), CcnxStackHelper::InstallRouteTo, prefix, node2);
-        // CcnxStackHelper::InstallRouteTo (prefix, node2);
+        Simulator::Schedule (Seconds(10.0), Experiment::InstallHijacker, prefix, node2);
 
         prefixes.push_back (prefix); // remember prefixes that consumers will be requesting
       }
-
-    // All consumers request exactly 10 packets, to convert number interests packets to requested size:
-    // size = 1040 * (max_number_of_packets-1) / 1024 / 1024
-    // double requestSize = 1040.0 * (10 - 1) / 1024.0 / 1024.0;
     
     // Create Consumers
     NodeContainer nodes = reader->GetNodes ();
@@ -299,7 +301,7 @@
 
         CcnxAppHelper consumerHelper ("ns3::CcnxConsumerBatches");
         consumerHelper.SetAttribute ("LifeTime", StringValue("100s"));
-        consumerHelper.SetAttribute ("Batches", StringValue("0s 10 0.5s 1 2s 1"));
+        consumerHelper.SetAttribute ("Batches", StringValue("0s 10 6s 1 20s 1"));
         BOOST_FOREACH (const string &prefix, prefixes)
           {
             consumerHelper.SetPrefix (prefix + "/" + lexical_cast<string> (namedId)); // make sure we're requesting unique prefixes... this was a huge bug before                 
@@ -344,7 +346,8 @@
       cout << "seed = " << SeedManager::GetSeed () << ", run = " << SeedManager::GetRun () << endl;
 
       Experiment experiment;
-      experiment.GenerateRandomPairs (1);
+      // experiment.GenerateRandomPairs (1);
+      experiment.SetPair (run);
       experiment.ComputeShortestWeightsPath(1,12);
       experiment.ComputeShortestDelayPath(1,12);
       cout << "Run " << run << endl;
@@ -360,12 +363,9 @@
       // traceHelper.EnableRateL3All (prefix + "rate-trace.log");
       traceHelper.EnableSeqsAppAll ("ns3::CcnxConsumerBatches", prefix + "consumers-seqs.log");
 
-      traceHelper.EnablePathWeights (prefix + "weights.log");
+      // enable path weights some time from now (ensure that all faces are created)
+      Simulator::Schedule (Seconds (4.5), &CcnxTraceHelper::EnablePathWeights, &traceHelper, prefix + "weights.log");
       std::cout << "Total " << apps.GetN () << " applications\n";
-      for (ApplicationContainer::Iterator i = apps.Begin (); i != apps.End (); i++)
-        {
-          Simulator::Schedule (Seconds (0.45), &CcnxTraceHelper::WeightsConnect, &traceHelper, (*i)->GetNode (), *i);
-        }
 
       experiment.Run (Seconds(40.0));
     }
