diff --git a/demo/chatdialog.cpp b/demo/chatdialog.cpp
index b7edf20..6fd93df 100644
--- a/demo/chatdialog.cpp
+++ b/demo/chatdialog.cpp
@@ -17,6 +17,8 @@
   DigestTreeScene *scene = new DigestTreeScene();
 
   treeViewer->setScene(scene);
+  QRectF rect = scene->itemsBoundingRect();
+  scene->setSceneRect(rect);
   //scene->plot();
 
   connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
@@ -144,3 +146,21 @@
     updateLabels();
   }
 }
+
+void 
+ChatDialog::resizeEvent(QResizeEvent *e)
+{
+  fitView();
+}
+
+void 
+ChatDialog::showEvent(QShowEvent *e)
+{
+  fitView();
+}
+
+void
+ChatDialog::fitView()
+{
+  treeViewer->fitInView(treeViewer->scene()->itemsBoundingRect(), Qt::KeepAspectRatio);
+}
diff --git a/demo/chatdialog.h b/demo/chatdialog.h
index 3ae668b..9ca77c0 100644
--- a/demo/chatdialog.h
+++ b/demo/chatdialog.h
@@ -26,6 +26,9 @@
   void readSettings();
   void writeSettings();
   void updateLabels();
+  void resizeEvent(QResizeEvent *);
+  void showEvent(QShowEvent *);
+  void fitView();
 
 private slots:
   void returnPressed();
diff --git a/demo/digesttreescene.cpp b/demo/digesttreescene.cpp
index 2d2f631..5133e4c 100644
--- a/demo/digesttreescene.cpp
+++ b/demo/digesttreescene.cpp
@@ -10,9 +10,33 @@
 
 static const double Pi = 3.14159265358979323846264338327950288419717;
 
+static void 
+testDraw(DigestTreeScene * scene) 
+{
+  std::string prefix[5] = {"/ndn/1", "/ndn/2", "/ndn/3", "/ndn/4", "/ndn/5"};
+  std::string nick[5] = {"tom", "jerry", "jason", "michael", "hurry"};
+  std::vector<Sync::MissingDataInfo> v;
+  for (int i = 0; i < 5; i++)
+  {
+    Sync::MissingDataInfo mdi = {prefix[i], Sync::SeqNo(0), Sync::SeqNo(i * (2 << i) )};
+    v.push_back(mdi);
+  }
+
+  scene->processUpdate(v, "12341234@!#%!@");
+
+  for (int i = 0; i < 5; i++)
+  {
+   scene-> msgReceived(prefix[i].c_str(), nick[i].c_str());
+  }
+}
+
+DigestTreeScene::DisplayUserPtr DigestTreeScene::DisplayUserNullPtr;
+
 DigestTreeScene::DigestTreeScene(QWidget *parent)
   : QGraphicsScene(parent)
 {
+  previouslyUpdatedUser = DisplayUserNullPtr;
+  testDraw(this);
 }
 
 void
@@ -44,8 +68,12 @@
       if (it != m_roster.end()) {
         DisplayUserPtr p = it.value();
         QGraphicsTextItem *item = p->getSeqTextItem();
+        QGraphicsRectItem *rectItem = p->getInnerRectItem();
         std::string s = boost::lexical_cast<std::string>(p->getSeqNo().getSeq());
         item->setPlainText(s.c_str());
+        QRectF textBR = item->boundingRect();
+        QRectF rectBR = rectItem->boundingRect();
+        item->setPos(rectBR.x() + (rectBR.width() - textBR.width())/2, rectBR.y() + (rectBR.height() - textBR.height())/2);
       }
     }
     m_rootDigest->setPlainText(digest);
@@ -53,6 +81,21 @@
 }
 
 void
+DigestTreeScene::reDrawNode(DisplayUserPtr p, QColor rimColor)
+{
+    QGraphicsRectItem *rimItem = p->getRimRectItem();
+    rimItem->setBrush(QBrush(rimColor));
+    QGraphicsRectItem *innerItem = p->getInnerRectItem();
+    innerItem->setBrush(QBrush(Qt::lightGray));
+    QGraphicsTextItem *seqTextItem = p->getSeqTextItem();
+    std::string s = boost::lexical_cast<std::string>(p->getSeqNo().getSeq());
+    seqTextItem->setPlainText(s.c_str());
+    QRectF textBR = seqTextItem->boundingRect();
+    QRectF innerBR = innerItem->boundingRect();
+    seqTextItem->setPos(innerBR.x() + (innerBR.width() - textBR.width())/2, innerBR.y() + (innerBR.height() - textBR.height())/2);
+}
+
+void
 DigestTreeScene::msgReceived(QString prefix, QString nick)
 {
   Roster_iterator it = m_roster.find(prefix);
@@ -62,10 +105,21 @@
     if (nick != p->getNick()) {
       p->setNick(nick);
       QGraphicsTextItem *nickItem = p->getNickTextItem();
+      QGraphicsRectItem *nickRectItem = p->getNickRectItem();
       nickItem->setPlainText(p->getNick());
+      QRectF rectBR = nickRectItem->boundingRect();
+      QRectF nickBR = nickItem->boundingRect();
+      nickItem->setPos(rectBR.x() + (rectBR.width() - nickBR.width())/2, rectBR.y() + 5);
     }
-    QGraphicsRectItem *rimItem = p->getRimRectItem();
-    rimItem->setBrush(QBrush(Qt::red));
+
+    reDrawNode(p, Qt::red);
+
+    if (previouslyUpdatedUser != DisplayUserNullPtr) 
+    {
+      reDrawNode(previouslyUpdatedUser, Qt::darkBlue);
+    }
+
+    previouslyUpdatedUser = p;
   }
 }
 
@@ -83,7 +137,7 @@
   }
   ogdf::GraphAttributes GA(m_graph);
 
-  int nodeSize = 50;
+  int nodeSize = 40;
   int siblingDistance = 100, levelDistance = 100;
   ogdf::TreeLayout layout;
   layout.siblingDistance(siblingDistance);
@@ -92,13 +146,15 @@
 
   int width = GA.boundingBox().width();
   int height = GA.boundingBox().height();
-  setSceneRect(QRect(- (width + nodeSize) / 2, - 40, width + nodeSize, height + nodeSize));
+  //setSceneRect(QRect(- (width + nodeSize) / 2, - 50, width + nodeSize, height + nodeSize));
   GA.setAllWidth(nodeSize);
   GA.setAllHeight(nodeSize);
 
   plotEdge(GA);
   plotNode(GA, rootIndex, digest);
 
+  previouslyUpdatedUser = DisplayUserNullPtr;
+
 }
 
 void
@@ -141,19 +197,19 @@
     int rim = 3;
     QRectF boundingRect(x, y, w, h);
     QRectF innerBoundingRect(x + rim, y + rim, w - rim * 2, h - rim * 2);
-    addRect(innerBoundingRect, QPen(Qt::black), QBrush(Qt::lightGray));
 
     if (n->index() == rootIndex) 
     {
       addRect(boundingRect, QPen(Qt::black), QBrush(Qt::darkRed));
+      addRect(innerBoundingRect, QPen(Qt::black), QBrush(Qt::lightGray));
 
-      QRectF digestRect(x - w / 2, y - h - 5, 2 * w, 30);
+      QRectF digestRect(x - w, y - h, 3 * w, 30);
       addRect(digestRect, QPen(Qt::darkCyan), QBrush(Qt::darkCyan));
       QGraphicsTextItem *digestItem = addText(digest);
       QRectF digestBoundingRect = digestItem->boundingRect();
       digestItem->setDefaultTextColor(Qt::white);
       digestItem->setFont(QFont("Cursive", 12, QFont::Bold));
-      digestItem->setPos(x + w / 2 - digestBoundingRect.width() / 2, y - h - 15);
+      digestItem->setPos(x - w + (3 * w - digestBoundingRect.width()) / 2, y - h + 5);
       m_rootDigest = digestItem;
     }
     else
@@ -170,6 +226,9 @@
       QGraphicsRectItem *rectItem = addRect(boundingRect, QPen(Qt::black), QBrush(Qt::darkBlue));
       p->setRimRectItem(rectItem);
 
+      QGraphicsRectItem *innerRectItem = addRect(innerBoundingRect, QPen(Qt::black), QBrush(Qt::lightGray));
+      p->setInnerRectItem(innerRectItem);
+
       std::string s = boost::lexical_cast<std::string>(p->getSeqNo().getSeq());
       QGraphicsTextItem *seqItem = addText(s.c_str());
       seqItem->setFont(QFont("Cursive", 12, QFont::Bold));
@@ -177,15 +236,17 @@
       seqItem->setPos(x + w / 2 - seqBoundingRect.width() / 2, y + h / 2 - seqBoundingRect.height() / 2);
       p->setSeqTextItem(seqItem);
 
-      QRectF textRect(x - w / 2, y + h + 10, 2 * w, 30);
-      addRect(textRect, QPen(Qt::darkCyan), QBrush(Qt::darkCyan));
+      QRectF textRect(x - w / 2, y + h, 2 * w, 30);
+      QGraphicsRectItem *nickRectItem = addRect(textRect, QPen(Qt::darkCyan), QBrush(Qt::darkCyan));
+      p->setNickRectItem(nickRectItem);
       QGraphicsTextItem *nickItem = addText(p->getNick());
       QRectF textBoundingRect = nickItem->boundingRect();
       nickItem->setDefaultTextColor(Qt::white);
       nickItem->setFont(QFont("Cursive", 12, QFont::Bold));
-      nickItem->setPos(x + w / 2 - textBoundingRect.width() / 2, y + h + 15);
+      nickItem->setPos(x + w / 2 - textBoundingRect.width() / 2, y + h + 5);
       p->setNickTextItem(nickItem);
     }
+
   }
 }
 
diff --git a/demo/digesttreescene.h b/demo/digesttreescene.h
index 5c8af9d..08a50d0 100644
--- a/demo/digesttreescene.h
+++ b/demo/digesttreescene.h
@@ -10,6 +10,7 @@
 #include <QMap>
 #include <vector>
 #include <tr1/memory>
+#include <QColor>
 
 class QGraphicsTextItem;
 
@@ -24,18 +25,22 @@
 typedef QMap<QString, DisplayUserPtr> Roster;
 typedef QMap<QString, DisplayUserPtr>::iterator Roster_iterator;
 typedef QMapIterator<QString, DisplayUserPtr> RosterIterator;
+static DisplayUserPtr DisplayUserNullPtr;
 
 public:
   DigestTreeScene(QWidget *parent = 0);
   void processUpdate(std::vector<Sync::MissingDataInfo> &v, QString digest);
   void msgReceived(QString prefix, QString nick);
+private:
   void plot(QString digest);
   void plotEdge(ogdf::GraphAttributes &GA);
   void plotNode(ogdf::GraphAttributes &GA, int rootIndex, QString digest);
+  void reDrawNode(DisplayUserPtr p, QColor rimColor);
 private:
   ogdf::Graph m_graph;
   Roster m_roster;
   QGraphicsTextItem *m_rootDigest; 
+  DisplayUserPtr previouslyUpdatedUser;
 
 };
 
@@ -70,13 +75,19 @@
   QGraphicsTextItem *getSeqTextItem() {return m_seqTextItem;}
   QGraphicsTextItem *getNickTextItem() {return m_nickTextItem;}
   QGraphicsRectItem *getRimRectItem() {return m_rimRectItem;}
+  QGraphicsRectItem *getInnerRectItem() {return m_innerRectItem;}
+  QGraphicsRectItem *getNickRectItem() {return m_nickRectItem;}
   void setSeqTextItem(QGraphicsTextItem *item) { m_seqTextItem = item;}
   void setNickTextItem(QGraphicsTextItem *item) { m_nickTextItem = item;}
   void setRimRectItem(QGraphicsRectItem *item) {m_rimRectItem = item;}
+  void setInnerRectItem(QGraphicsRectItem *item) {m_innerRectItem = item;}
+  void setNickRectItem(QGraphicsRectItem *item) {m_nickRectItem = item;}
 private:
   QGraphicsTextItem *m_seqTextItem;
   QGraphicsTextItem *m_nickTextItem;
   QGraphicsRectItem *m_rimRectItem;
+  QGraphicsRectItem *m_innerRectItem;
+  QGraphicsRectItem *m_nickRectItem;
 };
 
 #endif
