diff --git a/chatdialog.cpp b/chatdialog.cpp
index 10c7af0..0704ddd 100644
--- a/chatdialog.cpp
+++ b/chatdialog.cpp
@@ -7,6 +7,28 @@
 
 #define BROADCAST_PREFIX_FOR_SYNC_DEMO "/ndn/broadcast/sync-demo"
 
+void
+ChatDialog::testDraw()
+{
+  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);
+  }
+
+  m_scene->processUpdate(v, "12341234@!#%!@");
+
+  for (int i = 0; i < 5; i++)
+  {
+   m_scene-> msgReceived(prefix[i].c_str(), nick[i].c_str());
+  }
+
+  fitView();
+}
+
 ChatDialog::ChatDialog(QWidget *parent)
   : QDialog(parent), m_sock(NULL)
 {
@@ -35,6 +57,7 @@
 
   connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
   connect(setButton, SIGNAL(pressed()), this, SLOT(buttonPressed()));
+  testDraw();
 }
 
 ChatDialog::~ChatDialog()
@@ -273,5 +296,7 @@
 void
 ChatDialog::fitView()
 {
+  QRectF rect = m_scene->itemsBoundingRect();
+  m_scene->setSceneRect(rect);
   treeViewer->fitInView(m_scene->itemsBoundingRect(), Qt::KeepAspectRatio);
 }
diff --git a/chatdialog.h b/chatdialog.h
index 252144b..ea95873 100644
--- a/chatdialog.h
+++ b/chatdialog.h
@@ -32,6 +32,7 @@
   void resizeEvent(QResizeEvent *);
   void showEvent(QShowEvent *);
   void fitView();
+  void testDraw();
 
 private slots:
   void returnPressed();
diff --git a/digesttreescene.cpp b/digesttreescene.cpp
index 0dd7a10..d987633 100644
--- a/digesttreescene.cpp
+++ b/digesttreescene.cpp
@@ -1,34 +1,13 @@
-#include "digesttreescene.h"
 #include <QtGui>
-#include "ogdf/basic/Array.h"
-#include "ogdf/basic/Graph_d.h"
-#include "ogdf/tree/TreeLayout.h"
 #include <vector>
 #include <iostream>
 #include <assert.h>
 #include <boost/lexical_cast.hpp>
+#include <memory>
+#include "digesttreescene.h"
 
 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;
 
@@ -36,7 +15,6 @@
   : QGraphicsScene(parent)
 {
   previouslyUpdatedUser = DisplayUserNullPtr;
-//  testDraw(this);
 }
 
 void
@@ -112,7 +90,6 @@
 DigestTreeScene::clearAll()
 {
   clear();
-  m_graph.clear();
   m_roster.clear();
 }
 
@@ -120,46 +97,33 @@
 DigestTreeScene::plot(QString digest)
 {
   clear();
-  m_graph.clear();
-  int n = m_roster.size();
-  ogdf::node root = m_graph.newNode();
-  int rootIndex = root->index();
-  for (int i = 0; i < n; i++) {
-     ogdf::node leaf = m_graph.newNode();
-     m_graph.newEdge(root, leaf);
-  }
-  ogdf::GraphAttributes GA(m_graph);
 
   int nodeSize = 40;
+
   int siblingDistance = 100, levelDistance = 100;
-  ogdf::TreeLayout layout;
-  layout.siblingDistance(siblingDistance);
-  layout.levelDistance(levelDistance);
-  layout.callSortByPositions(GA, m_graph);
+  std::auto_ptr<TreeLayout> layout(new OneLevelTreeLayout());
+  layout->setSiblingDistance(siblingDistance);
+  layout->setLevelDistance(levelDistance);
 
-  int width = GA.boundingBox().width();
-  int height = GA.boundingBox().height();
-  //setSceneRect(QRect(- (width + nodeSize) / 2, - 50, width + nodeSize, height + nodeSize));
-  GA.setAllWidth(nodeSize);
-  GA.setAllHeight(nodeSize);
+  int n = m_roster.size();
+  std::vector<TreeLayout::Coordinate> childNodesCo(n);
 
-  plotEdge(GA);
-  plotNode(GA, rootIndex, digest);
+  layout->setOneLevelLayout(childNodesCo);
+
+  plotEdge(childNodesCo, nodeSize);
+  plotNode(childNodesCo, digest, nodeSize);
 
   previouslyUpdatedUser = DisplayUserNullPtr;
 
 }
 
 void
-DigestTreeScene::plotEdge(ogdf::GraphAttributes &GA)
+DigestTreeScene::plotEdge(const std::vector<TreeLayout::Coordinate> &childNodesCo, int nodeSize)
 {
-  ogdf::edge e;
-  forall_edges(e, m_graph) {
-    ogdf::node source = e->source();
-    ogdf::node target = e->target();
-    int nodeSize = GA.width(target);
-    int x1 = GA.x(source), y1 = -GA.y(source);
-    int x2 = GA.x(target), y2 = -GA.y(target);
+  int n = childNodesCo.size();
+  for (int i = 0; i < n; i++) {
+    double x1 = 0.0, y1 = 0.0;
+    double x2 = childNodesCo[i].x, y2 = childNodesCo[i].y;
     QPointF src(x1 + nodeSize/2, y1 + nodeSize/2);
     QPointF dest(x2 + nodeSize/2, y2 + nodeSize/2);
     QLineF line(src, dest);
@@ -178,69 +142,67 @@
 }
 
 void
-DigestTreeScene::plotNode(ogdf::GraphAttributes &GA, int rootIndex, QString digest)
+DigestTreeScene::plotNode(const std::vector<TreeLayout::Coordinate> &childNodesCo, QString digest, int nodeSize)
 {
-  ogdf::node n;
   RosterIterator it(m_roster);
-  forall_nodes(n, m_graph) {
-    double x = GA.x(n);
-    double y = -GA.y(n);
-    double w = GA.width(n);
-    double h = GA.height(n);
-    int rim = 3;
-    QRectF boundingRect(x, y, w, h);
-    QRectF innerBoundingRect(x + rim, y + rim, w - rim * 2, h - rim * 2);
+  int n = childNodesCo.size();
+  int rim = 3;
 
-    if (n->index() == rootIndex) 
+  // plot root node
+  QRectF rootBoundingRect(0, 0, nodeSize, nodeSize);
+  QRectF rootInnerBoundingRect(rim, rim, nodeSize - rim * 2, nodeSize - rim * 2);
+  addRect(rootBoundingRect, QPen(Qt::black), QBrush(Qt::darkRed));
+  addRect(rootInnerBoundingRect, QPen(Qt::black), QBrush(Qt::lightGray));
+  QRectF digestRect(- nodeSize, - nodeSize, 3 * nodeSize, 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(- nodeSize + (3 * nodeSize - digestBoundingRect.width()) / 2, - nodeSize + 5);
+  m_rootDigest = digestItem;
+
+  // plot child nodes
+  for (int i = 0; i < n; i++)
+  {
+    if (it.hasNext()) 
     {
-      addRect(boundingRect, QPen(Qt::black), QBrush(Qt::darkRed));
-      addRect(innerBoundingRect, QPen(Qt::black), QBrush(Qt::lightGray));
-
-      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 + (3 * w - digestBoundingRect.width()) / 2, y - h + 5);
-      m_rootDigest = digestItem;
+      it.next();
     }
-    else
+    else 
     {
-      if (it.hasNext()) 
-      {
-        it.next();
-      }
-      else 
-      {
-        abort();
-      }
-      DisplayUserPtr p = it.value();
-      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));
-      QRectF seqBoundingRect = seqItem->boundingRect(); 
-      seqItem->setPos(x + w / 2 - seqBoundingRect.width() / 2, y + h / 2 - seqBoundingRect.height() / 2);
-      p->setSeqTextItem(seqItem);
-
-      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 + 5);
-      p->setNickTextItem(nickItem);
+      abort();
     }
 
+    double x = childNodesCo[i].x;
+    double y = childNodesCo[i].y;
+    QRectF boundingRect(x, y, nodeSize, nodeSize);
+    QRectF innerBoundingRect(x + rim, y + rim, nodeSize - rim * 2, nodeSize - rim * 2);
+    DisplayUserPtr p = it.value();
+    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));
+    QRectF seqBoundingRect = seqItem->boundingRect(); 
+    seqItem->setPos(x + nodeSize / 2 - seqBoundingRect.width() / 2, y + nodeSize / 2 - seqBoundingRect.height() / 2);
+    p->setSeqTextItem(seqItem);
+
+    QRectF textRect(x - nodeSize / 2, y + nodeSize, 2 * nodeSize, 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 + nodeSize / 2 - textBoundingRect.width() / 2, y + nodeSize + 5);
+    p->setNickTextItem(nickItem);
   }
+
 }
 
 void
diff --git a/digesttreescene.h b/digesttreescene.h
index 91876e6..f041b11 100644
--- a/digesttreescene.h
+++ b/digesttreescene.h
@@ -2,8 +2,6 @@
 #define DIGESTTREESCENE_H
 
 #include <QtGui/QGraphicsScene>
-#include "ogdf/basic/GraphAttributes.h"
-#include "ogdf/basic/Graph.h"
 #include <sync-seq-no.h>
 #include <sync-logic.h>
 #include <ctime>
@@ -11,6 +9,7 @@
 #include <vector>
 #include <tr1/memory>
 #include <QColor>
+#include "treelayout.h"
 
 class QGraphicsTextItem;
 
@@ -34,11 +33,10 @@
   void clearAll();
   void plot(QString digest);
 private:
-  void plotEdge(ogdf::GraphAttributes &GA);
-  void plotNode(ogdf::GraphAttributes &GA, int rootIndex, QString digest);
+  void plotEdge(const std::vector<TreeLayout::Coordinate> &v, int nodeSize);
+  void plotNode(const std::vector<TreeLayout::Coordinate> &v, QString digest, int nodeSize);
   void reDrawNode(DisplayUserPtr p, QColor rimColor);
 private:
-  ogdf::Graph m_graph;
   Roster m_roster;
   QGraphicsTextItem *m_rootDigest; 
   DisplayUserPtr previouslyUpdatedUser;
diff --git a/sync-demo.pro b/sync-demo.pro
index 96f6c7e..2eae1a3 100644
--- a/sync-demo.pro
+++ b/sync-demo.pro
@@ -2,12 +2,14 @@
 TARGET = sync-demo
 HEADERS = chatdialog.h \
           digesttreescene.h \
-          settingdialog.h
+          settingdialog.h \
+          treelayout.h
 
 SOURCES = main.cpp \
           chatdialog.cpp \
           digesttreescene.cpp \
-          settingdialog.cpp
+          settingdialog.cpp \
+          treelayout.cpp 
 
 FORMS = chatdialog.ui \
         settingdialog.ui
@@ -15,9 +17,9 @@
 QMAKE_CXXFLAGS *= -g 
 QMAKE_CFLAGS *= -g 
 
-QMAKE_LIBDIR *= /opt/local/lib /usr/local/lib /usr/lib ../../../third_party/OGDF/_release ../build
-INCLUDEPATH *= /opt/local/include /usr/local/include ../../../third_party/OGDF ../include
-LIBS *= -lccn -lssl -lcrypto -lpthread -lOGDF -lprotobuf -lsync
+QMAKE_LIBDIR *= /opt/local/lib /usr/local/lib /usr/lib ../build
+INCLUDEPATH *= /opt/local/include /usr/local/include ../include
+LIBS *= -lccn -lssl -lcrypto -lpthread -lprotobuf -lsync
 CONFIG += console 
 
 PROTOS = chatbuf.proto
diff --git a/treelayout.h b/treelayout.h
index e72ef0e..498210c 100644
--- a/treelayout.h
+++ b/treelayout.h
@@ -26,7 +26,7 @@
 {
 public:
   OneLevelTreeLayout(){}
-  virtual void setOneLevelLayout(std::vector<Coordinate> &v, int childNumber);
+  virtual void setOneLevelLayout(std::vector<Coordinate> &childNodesCo);
   virtual ~OneLevelTreeLayout(){}
 };
 #endif
