diff --git a/utils/load-stats-face.cc b/utils/load-stats-face.cc
index 2e66197..09f3d05 100644
--- a/utils/load-stats-face.cc
+++ b/utils/load-stats-face.cc
@@ -20,9 +20,22 @@
 
 #include "load-stats-face.h"
 
+#include "ns3/log.h"
+
+#include <boost/mpl/for_each.hpp>
+#include <boost/mpl/range_c.hpp>
+
+using namespace boost::mpl;
+using namespace boost::tuples;
+
+NS_LOG_COMPONENT_DEFINE ("LoadStatsFace");
+
 namespace ndnSIM
 {
 
+std::ostream &
+operator << (std::ostream &os, const LoadStats::stats_tuple &tuple);
+
 void
 LoadStatsFace::Step ()
 {
@@ -30,22 +43,47 @@
   m_satisfied.Step ();
   m_unsatisfied.Step ();
 }
-  
-//
+
+struct update_retval
+{
+  update_retval (const LoadStats &count, const LoadStats &other, LoadStats::stats_tuple &tuple)
+    : count_ (count)
+    , other_ (other)
+    , tuple_ (tuple) {}
+  const LoadStats &count_;
+  const LoadStats &other_;
+  LoadStats::stats_tuple &tuple_;
+    
+  template< typename U >
+  void operator () (U)
+  {
+    if (count_.GetStats ().get<U::value> () < LoadStats::PRECISION)
+      tuple_.get<U::value> () = -1;
+    else
+      tuple_.get<U::value> () = other_.GetStats ().get<U::value> () / count_.GetStats ().get<U::value> ();
+  }
+};
+
 LoadStats::stats_tuple
 LoadStatsFace::GetSatisfiedRatio () const
 {
-  return LoadStats::stats_tuple (m_satisfied.GetStats ().get<0> () / std::max (0.01, m_count.GetStats ().get<0> ()),
-				 m_satisfied.GetStats ().get<1> () / std::max (0.01, m_count.GetStats ().get<1> ()),
-				 m_satisfied.GetStats ().get<2> () / std::max (0.01, m_count.GetStats ().get<2> ()));
+  LoadStats::stats_tuple retval;
+  for_each< range_c<int, 0, length<LoadStats::stats_tuple>::value> >
+    (update_retval (m_count, m_satisfied, retval));
+
+  NS_LOG_DEBUG (retval.get<0> () << ", " << retval.get<1> () << ", " << retval.get<2> ());
+  return retval;
 }
 
 LoadStats::stats_tuple
 LoadStatsFace::GetUnsatisfiedRatio () const
 {
-  return LoadStats::stats_tuple (m_unsatisfied.GetStats ().get<0> () / std::max (0.01, m_count.GetStats ().get<0> ()),
-				 m_unsatisfied.GetStats ().get<1> () / std::max (0.01, m_count.GetStats ().get<1> ()),
-				 m_unsatisfied.GetStats ().get<2> () / std::max (0.01, m_count.GetStats ().get<2> ()));
+  LoadStats::stats_tuple retval;
+  for_each< range_c<int, 0, length<LoadStats::stats_tuple>::value> >
+    (update_retval (m_count, m_unsatisfied, retval));
+
+  NS_LOG_DEBUG (retval.get<0> () << ", " << retval.get<1> () << ", " << retval.get<2> ());
+  return retval;
 }
   
 LoadStatsFace &
@@ -64,10 +102,42 @@
   return m_count.IsZero () && m_satisfied.IsZero () && m_unsatisfied.IsZero ();
 }
 
+struct print_tuple
+{
+  print_tuple (const LoadStats::stats_tuple &tuple, std::ostream &os)
+    : tuple_ (tuple)
+    , os_ (os)
+  {
+  }
+  
+  const LoadStats::stats_tuple &tuple_;
+  std::ostream &os_;
+    
+  template< typename U >
+  void operator () (U)
+  {
+    os_ << tuple_.get< U::value > () << " ";
+  }
+};
+
+
+std::ostream &
+operator << (std::ostream &os, const LoadStats::stats_tuple &tuple)
+{
+  for_each< range_c<int, 0, length<LoadStats::stats_tuple>::value> >
+    (print_tuple (tuple, os));
+  
+  return os;
+}
+
 std::ostream &
 operator << (std::ostream &os, const LoadStatsFace &stats)
 {
-  os << stats.m_count << "/" << stats.m_satisfied << "/" << stats.m_unsatisfied;
+  LoadStats::stats_tuple
+    satisfied   = stats.GetSatisfiedRatio (),
+    unsatisfied = stats.GetUnsatisfiedRatio ();
+
+  os << "ration satisfied: " << satisfied << "/ unsatisfied: " << unsatisfied;
   return os;
 }
 
diff --git a/utils/load-stats.cc b/utils/load-stats.cc
index 8a663e3..66786fd 100644
--- a/utils/load-stats.cc
+++ b/utils/load-stats.cc
@@ -23,22 +23,26 @@
 
 using namespace ns3;
 
-const double EXP_1  = exp (-5.0/60.0);  /* 1/exp(5sec/1min) */
-const double EXP_5  = exp (-5.0/300.0); /* 1/exp(5sec/5min) */
-const double EXP_15 = exp (-5.0/900.0); /* 1/exp(5sec/15min) */
+// const double EXP_1  = (1-2.0/6.0);//exp (-1.0/5.0);  /* 1/exp(1sec/5sec) */
+// const double EXP_2  = (1-2.0/31.0);//exp (-1.0/30.0); /* 1/exp(1sec/30sec) */
+// const double EXP_3 = (1-2.0/61.0);//exp (-1.0/60.0); /* 1/exp(1sec/60sec) */
 
-const double EPSILON = 0.000001;
+const double EXP_1 = exp (-1.0/5.0);  /* 1/exp(1sec/5sec) */
+const double EXP_2 = exp (-1.0/30.0); /* 1/exp(1sec/30sec) */
+const double EXP_3 = exp (-1.0/60.0); /* 1/exp(1sec/60sec) */
 
 NS_LOG_COMPONENT_DEFINE ("LoadStats");
 
 namespace ndnSIM
 {
 
+const double LoadStats::PRECISION = 0.1;
+
 LoadStats::LoadStats ()
   : counter_ (0)
   , avg1_ (0)
-  , avg5_ (0)
-  , avg15_ (0)
+  , avg2_ (0)
+  , avg3_ (0)
 {
 }
 
@@ -48,9 +52,9 @@
   // NS_LOG_FUNCTION (this);
 
   // do magic
-  avg1_  = EXP_1 * avg1_  + (1 - EXP_1)  * counter_;
-  avg5_  = EXP_1 * avg5_  + (1 - EXP_5)  * counter_;
-  avg15_ = EXP_1 * avg15_ + (1 - EXP_15) * counter_;
+  avg1_ = EXP_1 * avg1_ + (1 - EXP_1) * counter_;
+  avg2_ = EXP_2 * avg2_ + (1 - EXP_2) * counter_;
+  avg3_ = EXP_3 * avg3_ + (1 - EXP_3) * counter_;
 
   counter_ = 0;
 }
@@ -76,22 +80,22 @@
 LoadStats::stats_tuple
 LoadStats::GetStats () const
 {
-  return stats_tuple (avg1_, avg5_, avg15_);
+  return stats_tuple (avg1_, avg2_, avg3_);
 }
 
 bool
 LoadStats::IsZero () const
 {
   return (counter_ == 0 &&
-          avg1_ < EPSILON &&
-	  avg5_ < EPSILON &&
-	  avg15_ < EPSILON);
+          avg1_ < PRECISION &&
+	  avg2_ < PRECISION &&
+	  avg3_ < PRECISION);
 }
 
 std::ostream &
 operator << (std::ostream &os, const LoadStats &stats)
 {
-  os << stats.avg1_ << ", " << stats.avg5_ << ", " << stats.avg15_;
+  os << stats.avg1_ << ", " << stats.avg2_ << ", " << stats.avg3_;
   return os;
 }
 
diff --git a/utils/load-stats.h b/utils/load-stats.h
index a9f2e5f..0b03ce5 100644
--- a/utils/load-stats.h
+++ b/utils/load-stats.h
@@ -32,6 +32,8 @@
 public:
   typedef boost::tuple<double, double, double> stats_tuple;
 
+  static const double PRECISION;
+
   LoadStats ();
   
   void
@@ -59,8 +61,8 @@
   uint32_t counter_;
 
   double avg1_;
-  double avg5_;
-  double avg15_;
+  double avg2_;
+  double avg3_;
 
   friend std::ostream &
   operator << (std::ostream &os, const LoadStats &stats);
