diff --git a/client/client.cc b/client/client.cc
new file mode 100644
index 0000000..8ab8013
--- /dev/null
+++ b/client/client.cc
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#include <iostream>
+#include <boost/algorithm/string.hpp>
+#include <config.h>
+#include <Ice/Ice.h>
+#include <chronoshare-client.ice.h>
+#include <sys/stat.h>
+#include <hash-helper.h>
+
+
+using namespace std;
+using namespace boost;
+using namespace ChronoshareClient;
+
+void
+usage ()
+{
+  cerr << "Usage: chronoshare <cmd> [<options>]\n"
+       << "\n"
+       << "   <cmd> is one of:\n"
+       << "       version\n"
+       << "       update <filename>\n"
+       << "       delete <filename>\n"
+       << "       move <filename> <filename>\n";
+  exit (1);
+}
+
+
+int
+main (int argc, char **argv)
+{
+  if (argc < 2)
+    {
+      usage ();
+    }
+
+  string cmd = argv[1];
+  algorithm::to_lower (cmd);
+  
+  if (cmd == "version")
+    {
+      cout << "chronoshare version " << CHRONOSHARE_VERSION << endl;
+      exit (0);
+    }
+  
+  int status = 0;
+  Ice::CommunicatorPtr ic;
+  try
+    {
+      // Create a communicator
+      //
+      ic = Ice::initialize (argc, argv);
+    
+      Ice::ObjectPrx base = ic->stringToProxy("NotifyDaemon:default -p 55436");
+      if (!base)
+        {
+          throw "Could not create proxy";
+        }
+
+      NotifyPrx notify = NotifyPrx::checkedCast (base);
+      if (notify)
+        {
+
+          if (cmd == "update")
+            {
+              if (argc != 3)
+                {
+                  usage ();
+                }
+
+              struct stat fileStats;
+              int ok = stat (argv[2], &fileStats);
+              if (ok == 0)
+                {
+                  // Alex: the following code is platform specific :(
+                  
+                  char atimespec[26], mtimespec[26], ctimespec[26];
+                  ctime_r (&fileStats.st_atime, atimespec);
+                  ctime_r (&fileStats.st_mtime, mtimespec);
+                  ctime_r (&fileStats.st_ctime, ctimespec);
+
+                  HashPtr fileHash = Hash::FromFileContent (argv[2]);
+                  
+                  notify->updateFile (argv[2],
+                                      make_pair(reinterpret_cast<const ::Ice::Byte*> (fileHash->GetHash ()),
+                                                reinterpret_cast<const ::Ice::Byte*> (fileHash->GetHash ()) +
+                                                fileHash->GetHashBytes ()),
+                                      atimespec, mtimespec, ctimespec,
+                                      fileStats.st_mode);
+                }
+              else
+                {
+                  cerr << "File [" << argv[2] << "] doesn't exist or is not accessible" << endl;
+                  return 1;
+                }
+            }
+          else if (cmd == "delete")
+            {
+              if (argc != 3)
+                {
+                  usage ();
+                }
+              
+              notify->deleteFile (argv[2]);
+            }
+          else if (cmd == "move")
+            {
+              if (argc != 4)
+                {
+                  usage ();
+                }
+
+              
+              notify->moveFile (argv[2], argv[3]);
+            }
+        }
+      else
+        {
+          cerr << "Cannot connect to the daemon\n";
+          status = 1;
+        }
+    }
+  catch (const Ice::Exception& ex)
+    {
+      cerr << ex << endl;
+      status = 1;
+    }
+  
+  if (ic)
+    ic->destroy();
+  return status;
+}
diff --git a/daemon/daemon.cc b/daemon/daemon.cc
new file mode 100644
index 0000000..97fee4f
--- /dev/null
+++ b/daemon/daemon.cc
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#include "action-log.h"
+#include <iostream>
+#include <Ice/Service.h>
+#include <Ice/Identity.h>
+
+#include "notify-i.h"
+
+using namespace std;
+using namespace boost;
+using namespace ChronoshareClient;
+
+typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str; 
+
+class MyService : public Ice::Service
+{
+protected:
+  virtual bool start (int, char*[], int&)
+  {
+    _adapter = communicator ()->createObjectAdapterWithEndpoints ("ChronoShare", "default -p 55436");
+
+    Ice::Identity identity;
+    identity.name="NotifyDaemon";
+    NotifyPtr servant=new NotifyI;
+    
+    _adapter->add (servant, identity);
+    
+    _adapter->activate();
+    // status = EXIT_SUCCESS;
+    return true;    
+  }
+  
+private:
+    Ice::ObjectAdapterPtr _adapter;  
+};
+
+int
+main (int argc, char **argv)
+{
+  int status = 0;
+  
+  try
+    {
+      // DbHelper db ("./", "/ndn/ucla.edu/alex");
+      ActionLog bla ("./", "/ndn/ucla.edu/alex");
+
+      MyService svc;
+      status = svc.main (argc, argv);
+
+      // HashPtr hash = db.RememberStateInStateLog ();
+      // // should be empty
+      // cout << "Hash: [" << *hash << "]" << endl;
+
+      // //
+      // db.UpdateDeviceSeqno ("Alex", 1);
+      // hash = db.RememberStateInStateLog ();
+      // cout << "Hash: [" << *hash << "]" << endl;
+
+      // db.UpdateDeviceSeqno ("Alex", 2);
+      // hash = db.RememberStateInStateLog ();
+      // cout << "Hash: [" << *hash << "]" << endl;
+
+      // db.UpdateDeviceSeqno ("Alex", 2);
+      // hash = db.RememberStateInStateLog ();
+      // cout << "Hash: [" << *hash << "]" << endl;
+
+      // db.UpdateDeviceSeqno ("Alex", 1);
+      // hash = db.RememberStateInStateLog ();
+      // cout << "Hash: [" << *hash << "]" << endl;
+
+      // db.FindStateDifferences ("00", "ec0a9941fa726e1fb8f34ecdbd8e3faa75dc9dba22e6a2ea1d8482aae5fdfb52");
+      // db.FindStateDifferences ("ec0a9941fa726e1fb8f34ecdbd8e3faa75dc9dba22e6a2ea1d8482aae5fdfb52", "00");
+      // db.FindStateDifferences ("869c38c6dffe8911ced320aecc6d9244904d13d3e8cd21081311f2129b4557ce",
+      //                          "ec0a9941fa726e1fb8f34ecdbd8e3faa75dc9dba22e6a2ea1d8482aae5fdfb52");
+      // db.FindStateDifferences ("ec0a9941fa726e1fb8f34ecdbd8e3faa75dc9dba22e6a2ea1d8482aae5fdfb52",
+      //                          "869c38c6dffe8911ced320aecc6d9244904d13d3e8cd21081311f2129b4557ce");
+
+      // db.UpdateDeviceSeqno ("Bob", 1);
+      // hash = db.RememberStateInStateLog ();
+      // cout << "Hash: [" << *hash << "]" << endl;
+
+      // db.FindStateDifferences ("00", "48f4d95b503b9a79c2d5939fa67722b13fc01db861fc501d09efd0a38dbafab8");
+      // db.FindStateDifferences ("ec0a9941fa726e1fb8f34ecdbd8e3faa75dc9dba22e6a2ea1d8482aae5fdfb52",
+      //                          "48f4d95b503b9a79c2d5939fa67722b13fc01db861fc501d09efd0a38dbafab8");
+    }
+  catch (const Ice::Exception& e)
+    {
+      cerr << e << endl;
+      status = 1;
+    }
+  catch (const boost::exception &e)
+    {
+      cout << "ERRORR: " << *get_error_info<errmsg_info_str> (e) << endl;
+      status = 1;
+    }
+
+  return status;
+}
diff --git a/daemon/notify-i.cc b/daemon/notify-i.cc
new file mode 100644
index 0000000..0f8b004
--- /dev/null
+++ b/daemon/notify-i.cc
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#include "notify-i.h"
+#include <hash-helper.h>
+
+using namespace std;
+
+// NotifyI::NotifyI (DbHelperPtr &db)
+//   : m_db (db)
+// {
+// }
+
+void
+NotifyI::updateFile (const ::std::string &filename,
+                     const ::std::pair<const Ice::Byte*, const Ice::Byte*> &hashRaw,
+                     const ::std::string &atime,
+                     const ::std::string &mtime,
+                     const ::std::string &ctime,
+                     ::Ice::Int mode,
+                     const ::Ice::Current&)
+{
+  Hash hash (hashRaw.first, hashRaw.second-hashRaw.first);
+
+  // m_db->AddActionUpdate (filename, hash, atime, mtime, ctime, mode);
+  
+  // cout << "updateFile " << filename << " with hash " << hash << endl;
+}
+
+void
+NotifyI::moveFile (const ::std::string &oldFilename,
+                   const ::std::string &newFilename,
+                   const ::Ice::Current&)
+{
+  // cout << "moveFile from " << oldFilename << " to " << newFilename << endl;
+  // m_db->AddActionMove (filename, oldFilename);
+}
+
+void
+NotifyI::deleteFile (const ::std::string &filename,
+                     const ::Ice::Current&)
+{
+  // m_db->AddActionDelete (filename, oldFilename);
+  
+  // cout << "deleteFile " << filename << endl;
+}
+
diff --git a/daemon/notify-i.h b/daemon/notify-i.h
new file mode 100644
index 0000000..a2cea97
--- /dev/null
+++ b/daemon/notify-i.h
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#ifndef NOTIFY_I_H
+#define NOTIFY_I_H
+
+#include <chronoshare-client.ice.h>
+
+class NotifyI : public ChronoshareClient::Notify
+{
+public:
+  // NotifyI (DbHelperPtr &db);
+  
+  virtual void
+  updateFile (const ::std::string &filename,
+              const ::std::pair<const Ice::Byte*, const Ice::Byte*> &hash,
+              const ::std::string &atime,
+              const ::std::string &mtime,
+              const ::std::string &ctime,
+              ::Ice::Int mode,
+              const ::Ice::Current& = ::Ice::Current());
+
+  virtual void
+  moveFile (const ::std::string &oldFilename,
+            const ::std::string &newFilename,
+            const ::Ice::Current& = ::Ice::Current());
+  
+  virtual void
+  deleteFile (const ::std::string &filename,
+              const ::Ice::Current& = ::Ice::Current());
+
+private:
+  // DbHelperPtr m_db;
+};
+
+#endif // NOTIFY_I_H
diff --git a/src/action-log.cc b/src/action-log.cc
new file mode 100644
index 0000000..cf5156a
--- /dev/null
+++ b/src/action-log.cc
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2013 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#include "action-log.h"
+
+using namespace boost;
+using namespace std;
+
+ActionLog::ActionLog (const std::string &path, const std::string &localName)
+  : SyncLog (path)
+  , m_localName (localName)
+{
+}
+
+// local add action. remote action is extracted from content object
+void
+ActionLog::AddActionUpdate (const std::string &filename,
+                            const Hash &hash,
+                            const std::string &atime, const std::string &mtime, const std::string &ctime,
+                            int mode)
+{
+  int res = sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0);
+
+  // sqlite3_stmt *stmt;
+  // res += sqlite3_prepare_v2 (m_db, "SELECT version,device_id,seq_no FROM ActionLog WHERE filename=? ORDER BY version DESC,device_id DESC LIMIT 1", -1, &stmt, 0);
+
+  // if (res != SQLITE_OK)
+  //   {
+  //     BOOST_THROW_EXCEPTION (Error::Db ()
+  //                            << errmsg_info_str ("Some error with AddActionUpdate"));
+  //   }
+
+  // sqlite3_bind_text (stmt, 1, filename.c_str (), -1);
+  // if (sqlite3_step (stmt) == SQLITE_ROW)
+  //   {
+  //     // with parent
+  //     sqlite3_int64 version = sqlite3_value_int64 (stmt, 0) + 1;
+  //     sqlite3_int64 device_id = sqlite3_value_int64 (stmt, 1);
+  //     sqlite3_int64 seq_no = sqlite3_value_int64 (stmt, 0);
+
+      
+  //   }
+  // else
+  //   {
+  //     // without parent
+      
+  //   }
+
+  res += sqlite3_exec (m_db, "END TRANSACTION;", 0,0,0);
+}
+
+void
+ActionLog::AddActionMove (const std::string &oldFile, const std::string &newFile)
+{
+}
+
+void
+ActionLog::AddActionDelete (const std::string &filename)
+{
+}
diff --git a/src/action-log.h b/src/action-log.h
new file mode 100644
index 0000000..6827cba
--- /dev/null
+++ b/src/action-log.h
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2013 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#ifndef ACTION_LOG_H
+#define ACTION_LOG_H
+
+#include "sync-log.h"
+
+class ActionLog : public SyncLog
+{
+public:
+  ActionLog (const std::string &path, const std::string &localName);
+
+  
+  
+  
+  void
+  AddActionUpdate (const std::string &filename,
+                        const Hash &hash,
+                        const std::string &atime, const std::string &mtime, const std::string &ctime,
+                        int mode);
+
+  void
+  AddActionMove (const std::string &oldFile, const std::string &newFile);
+
+  void
+  AddActionDelete (const std::string &filename);
+  
+protected:
+  std::string m_localName;
+};
+
+#endif // ACTION_LOG_H
diff --git a/src/chronoshare-client.ice b/src/chronoshare-client.ice
new file mode 100644
index 0000000..be40c3e
--- /dev/null
+++ b/src/chronoshare-client.ice
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+module ChronoshareClient
+{
+  sequence<byte> HashBytes;
+  
+  interface Notify 
+  {
+    void updateFile (string filename, ["cpp:array"] HashBytes fileHash, string atime, string mtime, string ctime, int mode);
+
+    void moveFile (string origFilename, string newFilename);
+
+    void deleteFile (string filename);
+  };
+};
diff --git a/src/main.cc b/src/database-test.cc
similarity index 94%
rename from src/main.cc
rename to src/database-test.cc
index 82b5c7d..ba1fecc 100644
--- a/src/main.cc
+++ b/src/database-test.cc
@@ -15,12 +15,11 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
- *         Chaoyi Bian <bcy@pku.edu.cn>
- *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
  */
 
-#include "sqlite-helper.h"
+#include "db-helper.h"
 #include <iostream>
 
 using namespace std;
diff --git a/src/db-helper.cc b/src/db-helper.cc
new file mode 100644
index 0000000..9bd2d61
--- /dev/null
+++ b/src/db-helper.cc
@@ -0,0 +1,233 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#include "db-helper.h"
+// #include "sync-log.h"
+#include <boost/make_shared.hpp>
+#include <boost/ref.hpp>
+#include <boost/throw_exception.hpp>
+
+using namespace boost;
+
+const std::string INIT_DATABASE = "\
+PRAGMA foreign_keys = ON;                                       \n\
+                                                                \n\
+CREATE TABLE                                                    \n\
+    SyncNodes(                                                  \n\
+        device_id       INTEGER PRIMARY KEY AUTOINCREMENT,      \n\
+        device_name     TEXT NOT NULL,                          \n\
+        description     TEXT,                                   \n\
+        seq_no          INTEGER NOT NULL,                       \n\
+        last_known_tdi  TEXT,                                   \n\
+        last_update     TIMESTAMP                               \n\
+    );                                                          \n\
+                                                                \n\
+CREATE TRIGGER SyncNodesUpdater_trigger                                \n\
+    BEFORE INSERT ON SyncNodes                                         \n\
+    FOR EACH ROW                                                       \n\
+    WHEN (SELECT device_id                                             \n\
+             FROM SyncNodes                                            \n\
+             WHERE device_name=NEW.device_name)                        \n\
+         IS NOT NULL                                                   \n\
+    BEGIN                                                              \n\
+        UPDATE SyncNodes                                               \n\
+            SET seq_no=max(seq_no,NEW.seq_no)                          \n\
+            WHERE device_name=NEW.device_name;                         \n\
+        SELECT RAISE(IGNORE);                                          \n\
+    END;                                                               \n\
+                                                                       \n\
+CREATE INDEX SyncNodes_device_name ON SyncNodes (device_name);         \n\
+                                                                       \n\
+CREATE TABLE SyncLog(                                                  \n\
+        state_id    INTEGER PRIMARY KEY AUTOINCREMENT,                 \n\
+        state_hash  BLOB NOT NULL UNIQUE,                              \n\
+        last_update TIMESTAMP NOT NULL                                 \n\
+    );                                                                 \n\
+                                                                       \n\
+CREATE TABLE                                                            \n\
+    SyncStateNodes(                                                     \n\
+        id          INTEGER PRIMARY KEY AUTOINCREMENT,                  \n\
+        state_id    INTEGER NOT NULL                                    \n\
+            REFERENCES SyncLog (state_id) ON UPDATE CASCADE ON DELETE CASCADE, \n\
+        device_id   INTEGER NOT NULL                                    \n\
+            REFERENCES SyncNodes (device_id) ON UPDATE CASCADE ON DELETE CASCADE, \n\
+        seq_no      INTEGER NOT NULL                                    \n\
+    );                                                                  \n\
+                                                                        \n\
+CREATE INDEX SyncStateNodes_device_id ON SyncStateNodes (device_id);    \n\
+CREATE INDEX SyncStateNodes_state_id  ON SyncStateNodes (state_id);     \n\
+CREATE INDEX SyncStateNodes_seq_no    ON SyncStateNodes (seq_no);       \n\
+                                                                        \n\
+CREATE TRIGGER SyncLogGuard_trigger                                     \n\
+    BEFORE INSERT ON SyncLog                                            \n\
+    FOR EACH ROW                                                        \n\
+    WHEN (SELECT state_hash                                             \n\
+            FROM SyncLog                                                \n\
+            WHERE state_hash=NEW.state_hash)                            \n\
+        IS NOT NULL                                                     \n\
+    BEGIN                                                               \n\
+        DELETE FROM SyncLog WHERE state_hash=NEW.state_hash;            \n\
+    END;                                                                \n\
+                                                                        \n\
+CREATE TABLE ActionLog (                                                \n\
+    device_id   INTEGER NOT NULL,                                       \n\
+    seq_no      INTEGER NOT NULL,                                       \n\
+                                                                        \n\
+    action      CHAR(1) NOT NULL, /* 0 for \"update\", 1 for \"delete\". */ \n\
+    filename    TEXT NOT NULL,                                          \n\
+                                                                        \n\
+    version     INTEGER NOT NULL,                                       \n\
+    action_timestamp TIMESTAMP NOT NULL,                                \n\
+                                                                        \n\
+    file_hash   BLOB, /* NULL if action is \"delete\" */                \n\
+    file_atime  TIMESTAMP,                                              \n\
+    file_mtime  TIMESTAMP,                                              \n\
+    file_ctime  TIMESTAMP,                                              \n\
+    file_chmod  INTEGER,                                                \n\
+                                                                        \n\
+    parent_device_id INTEGER,                                           \n\
+    parent_seq_no    INTEGER,                                           \n\
+                                                                        \n\
+    action_name	     TEXT NOT NULL,                                     \n\
+    action_content_object BLOB NOT NULL,                                \n\
+                                                                        \n\
+    PRIMARY KEY (device_id, seq_no),                                    \n\
+                                                                        \n\
+    FOREIGN KEY (parent_device_id, parent_seq_no)                       \n\
+	REFERENCES ActionLog (device_id, parent_seq_no)                 \n\
+	ON UPDATE RESTRICT                                              \n\
+	ON DELETE SET NULL                                              \n\
+);                                                                      \n\
+                                                                        \n\
+CREATE INDEX ActionLog_filename_version ON ActionLog (filename,version);        \n\
+CREATE INDEX ActionLog_parent ON ActionLog (parent_device_id, parent_seq_no);   \n\
+CREATE INDEX ActionLog_action_name ON ActionLog (action_name);          \n\
+";
+
+DbHelper::DbHelper (const std::string &path)
+{
+  int res = sqlite3_open((path+"chronoshare.db").c_str (), &m_db);
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Cannot open/create dabatabase: [" + path + "chronoshare.db" + "]"));
+    }
+  
+  res = sqlite3_create_function (m_db, "hash", 2, SQLITE_ANY, 0, 0,
+                                 DbHelper::hash_xStep, DbHelper::hash_xFinal);
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Cannot create function ``hash''"));
+    }
+
+  // Alex: determine if tables initialized. if not, initialize... not sure what is the best way to go...
+  // for now, just attempt to create everything
+
+  char *errmsg = 0;
+  res = sqlite3_exec (m_db, INIT_DATABASE.c_str (), NULL, NULL, &errmsg);
+  if (res != SQLITE_OK && errmsg != 0)
+    {
+      std::cerr << "DEBUG: " << errmsg << std::endl;
+      sqlite3_free (errmsg);
+    }
+}
+
+DbHelper::~DbHelper ()
+{
+  int res = sqlite3_close (m_db);
+  if (res != SQLITE_OK)
+    {
+      // complain
+    }
+}
+
+void
+DbHelper::hash_xStep (sqlite3_context *context, int argc, sqlite3_value **argv)
+{
+  if (argc != 2)
+    {
+      // _LOG_ERROR ("Wrong arguments are supplied for ``hash'' function");
+      sqlite3_result_error (context, "Wrong arguments are supplied for ``hash'' function", -1);
+      return;
+    }
+  if (sqlite3_value_type (argv[0]) != SQLITE_TEXT ||
+      sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+    {
+      // _LOG_ERROR ("Hash expects (text,integer) parameters");
+      sqlite3_result_error (context, "Hash expects (text,integer) parameters", -1);
+      return;
+    }
+  
+  EVP_MD_CTX **hash_context = reinterpret_cast<EVP_MD_CTX **> (sqlite3_aggregate_context (context, sizeof (EVP_MD_CTX *)));
+
+  if (hash_context == 0)
+    {
+      sqlite3_result_error_nomem (context);
+      return;
+    }
+
+  if (*hash_context == 0)
+    {
+      *hash_context = EVP_MD_CTX_create ();
+      EVP_DigestInit_ex (*hash_context, HASH_FUNCTION (), 0);
+    }
+  
+  int nameBytes = sqlite3_value_bytes (argv[0]);
+  const unsigned char *name = sqlite3_value_text (argv[0]);
+  sqlite3_int64 seqno = sqlite3_value_int64 (argv[1]);
+
+  EVP_DigestUpdate (*hash_context, name, nameBytes);
+  EVP_DigestUpdate (*hash_context, &seqno, sizeof(sqlite3_int64));
+}
+
+void
+DbHelper::hash_xFinal (sqlite3_context *context)
+{
+  EVP_MD_CTX **hash_context = reinterpret_cast<EVP_MD_CTX **> (sqlite3_aggregate_context (context, sizeof (EVP_MD_CTX *)));
+
+  if (hash_context == 0)
+    {
+      sqlite3_result_error_nomem (context);
+      return;
+    }
+
+  if (*hash_context == 0) // no rows
+    {
+      char charNullResult = 0;
+      sqlite3_result_blob (context, &charNullResult, 1, SQLITE_TRANSIENT); //SQLITE_TRANSIENT forces to make a copy
+      return;
+    }
+  
+  unsigned char *hash = new unsigned char [EVP_MAX_MD_SIZE];
+  unsigned int hashLength = 0;
+
+  int ok = EVP_DigestFinal_ex (*hash_context,
+			       hash, &hashLength);
+
+  sqlite3_result_blob (context, hash, hashLength, SQLITE_TRANSIENT); //SQLITE_TRANSIENT forces to make a copy
+  delete [] hash;
+  
+  EVP_MD_CTX_destroy (*hash_context);
+}
+
+
+
diff --git a/src/db-helper.h b/src/db-helper.h
new file mode 100644
index 0000000..51970dd
--- /dev/null
+++ b/src/db-helper.h
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012-2013 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#ifndef DB_HELPER_H
+#define DB_HELPER_H
+
+#include <stdint.h>
+#include <sqlite3.h>
+#include <openssl/evp.h>
+#include <boost/exception/all.hpp>
+#include <string>
+#include "hash-helper.h"
+
+typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str; 
+
+class DbHelper
+{
+public:
+  DbHelper (const std::string &path);
+  virtual ~DbHelper ();
+  
+private:
+  static void
+  hash_xStep (sqlite3_context *context, int argc, sqlite3_value **argv);
+
+  static void
+  hash_xFinal (sqlite3_context *context);
+
+protected:
+  sqlite3 *m_db;
+};
+
+namespace Error {
+struct Db : virtual boost::exception, virtual std::exception { };
+}
+
+typedef boost::shared_ptr<DbHelper> DbHelperPtr;
+
+
+#endif // DB_HELPER_H
diff --git a/src/hash-string-converter.cc b/src/hash-helper.cc
similarity index 78%
rename from src/hash-string-converter.cc
rename to src/hash-helper.cc
index 2961069..04b52b2 100644
--- a/src/hash-string-converter.cc
+++ b/src/hash-helper.cc
@@ -19,12 +19,13 @@
  *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
  */
 
-#include "hash-string-converter.h"
+#include "hash-helper.h"
 
 #include <boost/assert.hpp>
 #include <boost/throw_exception.hpp>
 #include <boost/make_shared.hpp>
 #include <openssl/evp.h>
+#include <fstream>
 
 typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str; 
 typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int; 
@@ -101,29 +102,56 @@
   return os;
 }
 
-Hash::Hash (const std::string &hashInTextEncoding)
+HashPtr
+Hash::FromString (const std::string &hashInTextEncoding)
 {
+  HashPtr retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
+  
   if (hashInTextEncoding.size () == 0)
     {
-      m_buf = 0;
-      m_length = 0;
-      return;
+      return retval;
     }
 
   if (hashInTextEncoding.size () > EVP_MAX_MD_SIZE * 2)
     {
       cerr << "Input hash is too long. Returning an empty hash" << endl;
-      m_buf = 0;
-      m_length = 0;
-      return;
+      return retval;
     }
 
-  m_buf = new unsigned char [EVP_MAX_MD_SIZE];
+  
   
   unsigned char *end = copy (string_to_binary (hashInTextEncoding.begin ()),
                             string_to_binary (hashInTextEncoding.end ()),
-                            m_buf);
+                            retval->m_buf);
 
-  m_length = end-m_buf;
+  retval->m_length = end - retval->m_buf;
+
+  return retval;
 }
 
+HashPtr
+Hash::FromFileContent (const std::string &filename)
+{
+  HashPtr retval = make_shared<Hash> (reinterpret_cast<void*> (0), 0);
+  retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
+
+  EVP_MD_CTX *hash_context = EVP_MD_CTX_create ();
+  EVP_DigestInit_ex (hash_context, HASH_FUNCTION (), 0);
+
+  ifstream iff (filename.c_str (), std::ios::in | std::ios::binary);
+  while (iff.good ())
+    {
+      char buf[1024];
+      iff.read (buf, 1024);
+      EVP_DigestUpdate (hash_context, buf, iff.gcount ());
+    }
+
+  retval->m_buf = new unsigned char [EVP_MAX_MD_SIZE];
+
+  EVP_DigestFinal_ex (hash_context,
+                      retval->m_buf, &retval->m_length);
+  
+  EVP_MD_CTX_destroy (hash_context);
+
+  return retval;
+}
diff --git a/src/hash-string-converter.h b/src/hash-helper.h
similarity index 80%
rename from src/hash-string-converter.h
rename to src/hash-helper.h
index b696426..ea12f30 100644
--- a/src/hash-string-converter.h
+++ b/src/hash-helper.h
@@ -1,6 +1,6 @@
 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2012 University of California, Los Angeles
+ * Copyright (c) 2012-2013 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
@@ -19,18 +19,24 @@
  *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
  */
 
-#ifndef HASH_STRING_CONVERTER_H
-#define HASH_STRING_CONVERTER_H
+#ifndef HASH_HELPER_H
+#define HASH_HELPER_H
 
 #include <string.h>
 #include <iostream>
 #include <boost/shared_ptr.hpp>
 #include <boost/exception/all.hpp>
 
+// Other options: VP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_sha256, EVP_dss, EVP_dss1, EVP_mdc2, EVP_ripemd160
+#define HASH_FUNCTION EVP_sha256
+
+class Hash;
+typedef boost::shared_ptr<Hash> HashPtr;
+
 class Hash
 {
 public:
-  Hash (const void *buf, size_t length)
+  Hash (const void *buf, unsigned int length)
     : m_length (length)
   {
     if (m_length != 0)
@@ -40,8 +46,12 @@
       }
   }
 
-  Hash (const std::string &hashInTextEncoding);
+  static HashPtr
+  FromString (const std::string &hashInTextEncoding);
 
+  static HashPtr
+  FromFileContent (const std::string &hashInTextEncoding);
+  
   ~Hash ()
   {
     if (m_length != 0)
@@ -70,7 +80,7 @@
     return m_buf;
   }
 
-  size_t
+  unsigned int
   GetHashBytes () const
   {
     return m_length;
@@ -78,7 +88,7 @@
   
 private:
   unsigned char *m_buf;
-  size_t m_length;
+  unsigned int m_length;
 
   Hash (const Hash &) { }
   Hash & operator = (const Hash &) { return *this; }
@@ -91,8 +101,6 @@
 struct HashConversion : virtual boost::exception, virtual std::exception { };
 }
 
-typedef boost::shared_ptr<Hash> HashPtr;
-
 
 std::ostream &
 operator << (std::ostream &os, const Hash &digest);
diff --git a/src/sqlite-helper.cc b/src/sqlite-helper.cc
deleted file mode 100644
index 1a3ed1c..0000000
--- a/src/sqlite-helper.cc
+++ /dev/null
@@ -1,453 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
- */
-
-#include "sqlite-helper.h"
-// #include "sync-log.h"
-#include <boost/make_shared.hpp>
-#include <boost/ref.hpp>
-
-// Other options: VP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_sha256, EVP_dss, EVP_dss1, EVP_mdc2, EVP_ripemd160
-#define HASH_FUNCTION EVP_sha256
-
-#include <boost/throw_exception.hpp>
-typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str; 
-// typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int; 
-
-using namespace boost;
-
-const std::string INIT_DATABASE = "\
-PRAGMA foreign_keys = ON;                                       \
-                                                                \
-CREATE TABLE                                                    \
-    SyncNodes(                                                  \
-        device_id       INTEGER PRIMARY KEY AUTOINCREMENT,      \
-        device_name     TEXT NOT NULL,                          \
-        description     TEXT,                                   \
-        seq_no          INTEGER NOT NULL,                       \
-        last_known_tdi  TEXT,                                   \
-        last_update     TIMESTAMP                               \
-    );                                                          \
-                                                                \
-CREATE TRIGGER SyncNodesUpdater_trigger                                \
-    BEFORE INSERT ON SyncNodes                                         \
-    FOR EACH ROW                                                       \
-    WHEN (SELECT device_id                                             \
-             FROM SyncNodes                                            \
-             WHERE device_name=NEW.device_name)                        \
-         IS NOT NULL                                                   \
-    BEGIN                                                              \
-        UPDATE SyncNodes                                               \
-            SET seq_no=max(seq_no,NEW.seq_no)                          \
-            WHERE device_name=NEW.device_name;                         \
-        SELECT RAISE(IGNORE);                                          \
-    END;                                                               \
-                                                                       \
-CREATE INDEX SyncNodes_device_name ON SyncNodes (device_name);         \
-                                                                       \
-CREATE TABLE SyncLog(                                                  \
-        state_id    INTEGER PRIMARY KEY AUTOINCREMENT,                 \
-        state_hash  BLOB NOT NULL UNIQUE,                              \
-        last_update TIMESTAMP NOT NULL                                 \
-    );                                                                 \
-                                                                       \
-CREATE TABLE                                                            \
-    SyncStateNodes(                                                     \
-        id          INTEGER PRIMARY KEY AUTOINCREMENT,                  \
-        state_id    INTEGER NOT NULL                                    \
-            REFERENCES SyncLog (state_id) ON UPDATE CASCADE ON DELETE CASCADE, \
-        device_id   INTEGER NOT NULL                                    \
-            REFERENCES SyncNodes (device_id) ON UPDATE CASCADE ON DELETE CASCADE, \
-        seq_no      INTEGER NOT NULL                                    \
-    );                                                                  \
-                                                                        \
-CREATE INDEX SyncStateNodes_device_id ON SyncStateNodes (device_id);    \
-CREATE INDEX SyncStateNodes_state_id  ON SyncStateNodes (state_id);  \
-CREATE INDEX SyncStateNodes_seq_no    ON SyncStateNodes (seq_no);          \
-                                                                        \
-CREATE TRIGGER SyncLogGuard_trigger                                     \
-    BEFORE INSERT ON SyncLog                                            \
-    FOR EACH ROW                                                        \
-    WHEN (SELECT state_hash                                             \
-            FROM SyncLog                                                \
-            WHERE state_hash=NEW.state_hash)                            \
-        IS NOT NULL                                                     \
-    BEGIN                                                               \
-        DELETE FROM SyncLog WHERE state_hash=NEW.state_hash;            \
-    END;                                                                \
-";
-
-DbHelper::DbHelper (const std::string &path)
-{
-  int res = sqlite3_open((path+"chronoshare.db").c_str (), &m_db);
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Cannot open/create dabatabase: [" + path + "chronoshare.db" + "]"));
-    }
-  
-  res = sqlite3_create_function (m_db, "hash", 2, SQLITE_ANY, 0, 0,
-                                 DbHelper::hash_xStep, DbHelper::hash_xFinal);
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Cannot create function ``hash''"));
-    }
-
-  res = sqlite3_create_function (m_db, "hash2str", 2, SQLITE_ANY, 0,
-                                 DbHelper::hash2str_Func,
-                                 0, 0);
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Cannot create function ``hash''"));
-    }
-
-  res = sqlite3_create_function (m_db, "str2hash", 2, SQLITE_ANY, 0,
-                                 DbHelper::str2hash_Func,
-                                 0, 0);
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Cannot create function ``hash''"));
-    }
-  
-  // Alex: determine if tables initialized. if not, initialize... not sure what is the best way to go...
-  // for now, just attempt to create everything
-
-  char *errmsg = 0;
-  res = sqlite3_exec (m_db, INIT_DATABASE.c_str (), NULL, NULL, &errmsg);
-  if (res != SQLITE_OK && errmsg != 0)
-    {
-      std::cerr << "DEBUG: " << errmsg << std::endl;
-      sqlite3_free (errmsg);
-    }
-}
-
-DbHelper::~DbHelper ()
-{
-  int res = sqlite3_close (m_db);
-  if (res != SQLITE_OK)
-    {
-      // complain
-    }
-}
-
-HashPtr
-DbHelper::RememberStateInStateLog ()
-{
-  int res = sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0);
-
-  res += sqlite3_exec (m_db, "\
-INSERT INTO SyncLog                                     \
-    (state_hash, last_update)                           \
-    SELECT                                              \
-       hash(device_name, seq_no), datetime('now')       \
-    FROM SyncNodes                                      \
-    ORDER BY device_name;                               \
-", 0,0,0);
-
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("1"));
-    }
-  
-  sqlite3_int64 rowId = sqlite3_last_insert_rowid (m_db);
-  
-  sqlite3_stmt *insertStmt;
-  res += sqlite3_prepare (m_db, "\
-INSERT INTO SyncStateNodes                              \
-      (state_id, device_id, seq_no)                     \
-      SELECT ?, device_id, seq_no                       \
-            FROM SyncNodes;                             \
-", -1, &insertStmt, 0);
-
-  res += sqlite3_bind_int64 (insertStmt, 1, rowId);
-  sqlite3_step (insertStmt);
-
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("4"));
-    }
-  sqlite3_finalize (insertStmt);
-  
-  sqlite3_stmt *getHashStmt;
-  res += sqlite3_prepare (m_db, "\
-SELECT state_hash FROM SyncLog WHERE state_id = ?\
-", -1, &getHashStmt, 0);
-  res += sqlite3_bind_int64 (getHashStmt, 1, rowId);
-
-  HashPtr retval;
-  int stepRes = sqlite3_step (getHashStmt);
-  if (stepRes == SQLITE_ROW)
-    {
-      retval = make_shared<Hash> (sqlite3_column_blob (getHashStmt, 0),
-                                  sqlite3_column_bytes (getHashStmt, 0));
-    }
-  sqlite3_finalize (getHashStmt);
-  res += sqlite3_exec (m_db, "COMMIT;", 0,0,0);
-
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Some error with rememberStateInStateLog"));
-    }
-
-  return retval;
-}
-
-
-void
-DbHelper::hash_xStep (sqlite3_context *context, int argc, sqlite3_value **argv)
-{
-  if (argc != 2)
-    {
-      // _LOG_ERROR ("Wrong arguments are supplied for ``hash'' function");
-      sqlite3_result_error (context, "Wrong arguments are supplied for ``hash'' function", -1);
-      return;
-    }
-  if (sqlite3_value_type (argv[0]) != SQLITE_TEXT ||
-      sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
-    {
-      // _LOG_ERROR ("Hash expects (text,integer) parameters");
-      sqlite3_result_error (context, "Hash expects (text,integer) parameters", -1);
-      return;
-    }
-  
-  EVP_MD_CTX **hash_context = reinterpret_cast<EVP_MD_CTX **> (sqlite3_aggregate_context (context, sizeof (EVP_MD_CTX *)));
-
-  if (hash_context == 0)
-    {
-      sqlite3_result_error_nomem (context);
-      return;
-    }
-
-  if (*hash_context == 0)
-    {
-      *hash_context = EVP_MD_CTX_create ();
-      EVP_DigestInit_ex (*hash_context, HASH_FUNCTION (), 0);
-    }
-  
-  int nameBytes = sqlite3_value_bytes (argv[0]);
-  const unsigned char *name = sqlite3_value_text (argv[0]);
-  sqlite3_int64 seqno = sqlite3_value_int64 (argv[1]);
-
-  EVP_DigestUpdate (*hash_context, name, nameBytes);
-  EVP_DigestUpdate (*hash_context, &seqno, sizeof(sqlite3_int64));
-}
-
-void
-DbHelper::hash_xFinal (sqlite3_context *context)
-{
-  EVP_MD_CTX **hash_context = reinterpret_cast<EVP_MD_CTX **> (sqlite3_aggregate_context (context, sizeof (EVP_MD_CTX *)));
-
-  if (hash_context == 0)
-    {
-      sqlite3_result_error_nomem (context);
-      return;
-    }
-
-  if (*hash_context == 0) // no rows
-    {
-      char charNullResult = 0;
-      sqlite3_result_blob (context, &charNullResult, 1, SQLITE_TRANSIENT); //SQLITE_TRANSIENT forces to make a copy
-      return;
-    }
-  
-  unsigned char *hash = new unsigned char [EVP_MAX_MD_SIZE];
-  unsigned int hashLength = 0;
-
-  int ok = EVP_DigestFinal_ex (*hash_context,
-			       hash, &hashLength);
-
-  sqlite3_result_blob (context, hash, hashLength, SQLITE_TRANSIENT); //SQLITE_TRANSIENT forces to make a copy
-  delete [] hash;
-  
-  EVP_MD_CTX_destroy (*hash_context);
-}
-
-void
-DbHelper::hash2str_Func (sqlite3_context *context, int argc, sqlite3_value **argv)
-{
-  if (argc != 1 || sqlite3_value_type (argv[0]) != SQLITE_BLOB)
-    {
-      sqlite3_result_error (context, "Wrong arguments are supplied for ``hash2str'' function", -1);
-      return;
-    }
-
-  int hashBytes = sqlite3_value_bytes (argv[0]);
-  const void *hash = sqlite3_value_blob (argv[0]);
-
-  std::ostringstream os;
-  Hash tmpHash (hash, hashBytes);
-  os << tmpHash;
-  sqlite3_result_text (context, os.str ().c_str (), -1, SQLITE_TRANSIENT);
-}
-
-void
-DbHelper::str2hash_Func (sqlite3_context *context, int argc, sqlite3_value **argv)
-{
-  if (argc != 1 || sqlite3_value_type (argv[0]) != SQLITE_TEXT)
-    {
-      sqlite3_result_error (context, "Wrong arguments are supplied for ``str2hash'' function", -1);
-      return;
-    }
-
-  size_t hashTextBytes = sqlite3_value_bytes (argv[0]);
-  const unsigned char *hashText = sqlite3_value_text (argv[0]);
-
-  Hash hash (std::string (reinterpret_cast<const char*> (hashText), hashTextBytes));
-  sqlite3_result_blob (context, hash.GetHash (), hash.GetHashBytes (), SQLITE_TRANSIENT);
-}
-
-
-sqlite3_int64
-DbHelper::LookupSyncLog (const std::string &stateHash)
-{
-  Hash tmpHash (stateHash);
-  return LookupSyncLog (stateHash);
-}
-
-sqlite3_int64
-DbHelper::LookupSyncLog (const Hash &stateHash)
-{
-  sqlite3_stmt *stmt;
-  int res = sqlite3_prepare (m_db, "SELECT state_id FROM SyncLog WHERE state_hash = ?",
-                             -1, &stmt, 0);
-  
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Cannot prepare statement"));
-    }
-
-  res = sqlite3_bind_blob (stmt, 1, stateHash.GetHash (), stateHash.GetHashBytes (), SQLITE_STATIC);
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Cannot bind"));
-    }
-
-  sqlite3_int64 row = 0; // something bad
-
-  if (sqlite3_step (stmt) == SQLITE_ROW)
-    {
-      row = sqlite3_column_int64 (stmt, 0);
-    }
-
-  sqlite3_finalize (stmt);
-
-  return row;
-}
-
-void
-DbHelper::UpdateDeviceSeqno (const std::string &name, uint64_t seqNo)
-{
-  sqlite3_stmt *stmt;
-  // update is performed using trigger
-  int res = sqlite3_prepare (m_db, "INSERT INTO SyncNodes (device_name, seq_no) VALUES (?,?);", 
-                             -1, &stmt, 0);
-
-  res += sqlite3_bind_text  (stmt, 1, name.c_str (), name.size (), SQLITE_STATIC);
-  res += sqlite3_bind_int64 (stmt, 2, seqNo);
-  sqlite3_step (stmt);
-  
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Some error with UpdateDeviceSeqno"));
-    }
-  sqlite3_finalize (stmt);
-}
-
-void
-DbHelper::FindStateDifferences (const std::string &oldHash, const std::string &newHash)
-{
-  Hash tmpOldHash (oldHash);
-  Hash tmpNewHash (newHash);
-
-  FindStateDifferences (tmpOldHash, tmpNewHash);
-}
-
-void
-DbHelper::FindStateDifferences (const Hash &oldHash, const Hash &newHash)
-{
-  sqlite3_stmt *stmt;
-
-  int res = sqlite3_prepare_v2 (m_db, "\
-SELECT sn.device_name, s_old.seq_no, s_new.seq_no                       \
-    FROM (SELECT *                                                      \
-            FROM SyncStateNodes                                         \
-            WHERE state_id=(SELECT state_id                             \
-                                FROM SyncLog                            \
-                                WHERE state_hash=:old_hash)) s_old      \
-    LEFT JOIN (SELECT *                                                 \
-                FROM SyncStateNodes                                     \
-                WHERE state_id=(SELECT state_id                         \
-                                    FROM SyncLog                        \
-                                    WHERE state_hash=:new_hash)) s_new  \
-                                                                        \
-        ON s_old.device_id = s_new.device_id                            \
-    JOIN SyncNodes sn ON sn.device_id = s_old.device_id                 \
-                                                                        \
-    WHERE s_new.seq_no IS NULL OR                                       \
-          s_old.seq_no != s_new.seq_no                                  \
-                                                                        \
-UNION ALL                                                               \
-                                                                        \
-SELECT sn.device_name, s_old.seq_no, s_new.seq_no                       \
-    FROM (SELECT *                                                      \
-            FROM SyncStateNodes                                         \
-            WHERE state_id=(SELECT state_id                             \
-                                FROM SyncLog                            \
-                                WHERE state_hash=:new_hash )) s_new     \
-    LEFT JOIN (SELECT *                                                 \
-                FROM SyncStateNodes                                     \
-                WHERE state_id=(SELECT state_id                         \
-                                    FROM SyncLog                        \
-                                    WHERE state_hash=:old_hash)) s_old  \
-                                                                        \
-        ON s_old.device_id = s_new.device_id                            \
-    JOIN SyncNodes sn ON sn.device_id = s_new.device_id                 \
-                                                                        \
-    WHERE s_old.seq_no IS NULL                                          \
-", -1, &stmt, 0);
-
-  if (res != SQLITE_OK)
-    {
-      BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Some error with FindStateDifferences"));
-    }
-
-  res += sqlite3_bind_blob  (stmt, 1, oldHash.GetHash (), oldHash.GetHashBytes (), SQLITE_STATIC);
-  res += sqlite3_bind_blob  (stmt, 2, newHash.GetHash (), newHash.GetHashBytes (), SQLITE_STATIC);
-
-  while (sqlite3_step (stmt) == SQLITE_ROW)
-    {
-      std::cout << sqlite3_column_text (stmt, 0) <<
-        ": from "  << sqlite3_column_int64 (stmt, 1) <<
-        " to "     << sqlite3_column_int64 (stmt, 2) <<
-        std::endl;
-    }
-  sqlite3_finalize (stmt);
-  
-}
diff --git a/src/sqlite-helper.h b/src/sqlite-helper.h
deleted file mode 100644
index bf98fe8..0000000
--- a/src/sqlite-helper.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2012 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
- */
-
-#ifndef SQLITE_HELPER_H
-#define SQLITE_HELPER_H
-
-#include <stdint.h>
-#include <sqlite3.h>
-#include <openssl/evp.h>
-#include <boost/exception/all.hpp>
-#include <string>
-#include "hash-string-converter.h"
-
-// temporarily ignoring all potential database errors
-
-class DbHelper
-{
-public:
-  DbHelper (const std::string &path);
-  ~DbHelper ();
-
-  // done
-  void
-  UpdateDeviceSeqno (const std::string &name, uint64_t seqNo);
-
-  // std::string
-  // LookupForwardingAlias (const std::string &deviceName);
-
-  // void
-  // UpdateForwardingAlias ();
-
-  // done
-  /**
-   * Create an entry in SyncLog and SyncStateNodes corresponding to the current state of SyncNodes
-   */
-  HashPtr
-  RememberStateInStateLog ();
-
-  // done
-  sqlite3_int64
-  LookupSyncLog (const std::string &stateHash);
-
-  // done
-  sqlite3_int64
-  LookupSyncLog (const Hash &stateHash);
-
-  // How difference is exposed will be determined later by the actual protocol
-  void
-  FindStateDifferences (const std::string &oldHash, const std::string &newHash);
-
-  void
-  FindStateDifferences (const Hash &oldHash, const Hash &newHash);
-  
-private:
-  static void
-  hash_xStep (sqlite3_context *context, int argc, sqlite3_value **argv);
-
-  static void
-  hash_xFinal (sqlite3_context *context);
-
-  static void
-  hash2str_Func (sqlite3_context *context, int argc, sqlite3_value **argv);
-
-  static void
-  str2hash_Func (sqlite3_context *context, int argc, sqlite3_value **argv);
-  
-private:
-  sqlite3 *m_db;
-};
-
-namespace Error {
-struct Db : virtual boost::exception, virtual std::exception { };
-}
-
-
-#endif // SQLITE_HELPER_H
diff --git a/src/sync-log.cc b/src/sync-log.cc
new file mode 100644
index 0000000..3e49c69
--- /dev/null
+++ b/src/sync-log.cc
@@ -0,0 +1,236 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013 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: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#include "sync-log.h"
+
+#include <boost/make_shared.hpp>
+
+using namespace boost;
+using namespace std;
+
+HashPtr
+SyncLog::RememberStateInStateLog ()
+{
+  int res = sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0);
+
+  res += sqlite3_exec (m_db, "\
+INSERT INTO SyncLog                                     \
+    (state_hash, last_update)                           \
+    SELECT                                              \
+       hash(device_name, seq_no), datetime('now')       \
+    FROM SyncNodes                                      \
+    ORDER BY device_name;                               \
+", 0,0,0);
+
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("1"));
+    }
+  
+  sqlite3_int64 rowId = sqlite3_last_insert_rowid (m_db);
+  
+  sqlite3_stmt *insertStmt;
+  res += sqlite3_prepare (m_db, "\
+INSERT INTO SyncStateNodes                              \
+      (state_id, device_id, seq_no)                     \
+      SELECT ?, device_id, seq_no                       \
+            FROM SyncNodes;                             \
+", -1, &insertStmt, 0);
+
+  res += sqlite3_bind_int64 (insertStmt, 1, rowId);
+  sqlite3_step (insertStmt);
+
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("4"));
+    }
+  sqlite3_finalize (insertStmt);
+  
+  sqlite3_stmt *getHashStmt;
+  res += sqlite3_prepare (m_db, "\
+SELECT state_hash FROM SyncLog WHERE state_id = ?\
+", -1, &getHashStmt, 0);
+  res += sqlite3_bind_int64 (getHashStmt, 1, rowId);
+
+  HashPtr retval;
+  int stepRes = sqlite3_step (getHashStmt);
+  if (stepRes == SQLITE_ROW)
+    {
+      retval = make_shared<Hash> (sqlite3_column_blob (getHashStmt, 0),
+                                  sqlite3_column_bytes (getHashStmt, 0));
+    }
+  sqlite3_finalize (getHashStmt);
+  res += sqlite3_exec (m_db, "COMMIT;", 0,0,0);
+
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Some error with rememberStateInStateLog"));
+    }
+
+  return retval;
+}
+
+sqlite3_int64
+SyncLog::LookupSyncLog (const std::string &stateHash)
+{
+  return LookupSyncLog (*Hash::FromString (stateHash));
+}
+
+sqlite3_int64
+SyncLog::LookupSyncLog (const Hash &stateHash)
+{
+  sqlite3_stmt *stmt;
+  int res = sqlite3_prepare (m_db, "SELECT state_id FROM SyncLog WHERE state_hash = ?",
+                             -1, &stmt, 0);
+  
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Cannot prepare statement"));
+    }
+
+  res = sqlite3_bind_blob (stmt, 1, stateHash.GetHash (), stateHash.GetHashBytes (), SQLITE_STATIC);
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Cannot bind"));
+    }
+
+  sqlite3_int64 row = 0; // something bad
+
+  if (sqlite3_step (stmt) == SQLITE_ROW)
+    {
+      row = sqlite3_column_int64 (stmt, 0);
+    }
+
+  sqlite3_finalize (stmt);
+
+  return row;
+}
+
+void
+SyncLog::UpdateDeviceSeqno (const std::string &name, uint64_t seqNo)
+{
+  sqlite3_stmt *stmt;
+  // update is performed using trigger
+  int res = sqlite3_prepare (m_db, "INSERT INTO SyncNodes (device_name, seq_no) VALUES (?,?);", 
+                             -1, &stmt, 0);
+
+  res += sqlite3_bind_text  (stmt, 1, name.c_str (), name.size (), SQLITE_STATIC);
+  res += sqlite3_bind_int64 (stmt, 2, seqNo);
+  sqlite3_step (stmt);
+  
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Some error with UpdateDeviceSeqno"));
+    }
+  sqlite3_finalize (stmt);
+}
+
+SyncStateMsgPtr
+SyncLog::FindStateDifferences (const std::string &oldHash, const std::string &newHash)
+{
+  return FindStateDifferences (*Hash::FromString (oldHash), *Hash::FromString (newHash));
+}
+
+SyncStateMsgPtr
+SyncLog::FindStateDifferences (const Hash &oldHash, const Hash &newHash)
+{
+  sqlite3_stmt *stmt;
+
+  int res = sqlite3_prepare_v2 (m_db, "\
+SELECT sn.device_name, s_old.seq_no, s_new.seq_no                       \
+    FROM (SELECT *                                                      \
+            FROM SyncStateNodes                                         \
+            WHERE state_id=(SELECT state_id                             \
+                                FROM SyncLog                            \
+                                WHERE state_hash=:old_hash)) s_old      \
+    LEFT JOIN (SELECT *                                                 \
+                FROM SyncStateNodes                                     \
+                WHERE state_id=(SELECT state_id                         \
+                                    FROM SyncLog                        \
+                                    WHERE state_hash=:new_hash)) s_new  \
+                                                                        \
+        ON s_old.device_id = s_new.device_id                            \
+    JOIN SyncNodes sn ON sn.device_id = s_old.device_id                 \
+                                                                        \
+    WHERE s_new.seq_no IS NULL OR                                       \
+          s_old.seq_no != s_new.seq_no                                  \
+                                                                        \
+UNION ALL                                                               \
+                                                                        \
+SELECT sn.device_name, s_old.seq_no, s_new.seq_no                       \
+    FROM (SELECT *                                                      \
+            FROM SyncStateNodes                                         \
+            WHERE state_id=(SELECT state_id                             \
+                                FROM SyncLog                            \
+                                WHERE state_hash=:new_hash )) s_new     \
+    LEFT JOIN (SELECT *                                                 \
+                FROM SyncStateNodes                                     \
+                WHERE state_id=(SELECT state_id                         \
+                                    FROM SyncLog                        \
+                                    WHERE state_hash=:old_hash)) s_old  \
+                                                                        \
+        ON s_old.device_id = s_new.device_id                            \
+    JOIN SyncNodes sn ON sn.device_id = s_new.device_id                 \
+                                                                        \
+    WHERE s_old.seq_no IS NULL                                          \
+", -1, &stmt, 0);
+
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Some error with FindStateDifferences"));
+    }
+
+  res += sqlite3_bind_blob  (stmt, 1, oldHash.GetHash (), oldHash.GetHashBytes (), SQLITE_STATIC);
+  res += sqlite3_bind_blob  (stmt, 2, newHash.GetHash (), newHash.GetHashBytes (), SQLITE_STATIC);
+
+  SyncStateMsgPtr msg = make_shared<SyncStateMsg> ();
+  
+  while (sqlite3_step (stmt) == SQLITE_ROW)
+    {
+      SyncState *state = msg->add_state ();
+
+      state->set_name (reinterpret_cast<const char*> (sqlite3_column_text (stmt, 0)));
+
+      sqlite3_int64 newSeqNo = sqlite3_column_int64 (stmt, 2);
+      if (newSeqNo > 0)
+        {
+          state->set_type (SyncState::UPDATE);
+          state->set_seq (newSeqNo);
+        }
+      else
+        state->set_type (SyncState::DELETE);
+
+      // std::cout << sqlite3_column_text (stmt, 0) <<
+      //   ": from "  << sqlite3_column_int64 (stmt, 1) <<
+      //   " to "     << sqlite3_column_int64 (stmt, 2) <<
+      //   std::endl;
+    }
+  sqlite3_finalize (stmt);
+
+  return msg;
+}
diff --git a/src/sync-log.h b/src/sync-log.h
index 267a08d..5705e45 100644
--- a/src/sync-log.h
+++ b/src/sync-log.h
@@ -1,6 +1,6 @@
 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2012 University of California, Los Angeles
+ * Copyright (c) 2013 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
@@ -22,27 +22,51 @@
 #ifndef SYNC_LOG_H
 #define SYNC_LOG_H
 
-#define INIT_LOGGER(name)
-#define _LOG_FUNCTION(x)
-#define _LOG_FUNCTION_NOARGS
-#define _LOG_TRACE(x)
-#define INIT_LOGGERS(x)
+#include "db-helper.h"
+#include <sync-state.pb.h>
 
-#ifdef _DEBUG
+typedef boost::shared_ptr<SyncStateMsg> SyncStateMsgPtr;
 
-#include <boost/thread/thread.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <iostream>
-#include <string>
+class SyncLog : public DbHelper
+{
+public:
+  SyncLog (const std::string &path)
+    : DbHelper (path)
+  {
+  }
 
-#define _LOG_DEBUG(x) \
-  std::clog << boost::get_system_time () << " " << boost::this_thread::get_id () << " " << x << std::endl;
+  // done
+  void
+  UpdateDeviceSeqno (const std::string &name, uint64_t seqNo);
 
-#else
-#define _LOG_DEBUG(x)
-#endif
+  // std::string
+  // LookupForwardingAlias (const std::string &deviceName);
 
-#define _LOG_ERROR(x) \
-  std::clog << boost::get_system_time () << " " << boost::this_thread::get_id () << " " << x << std::endl;
+  // void
+  // UpdateForwardingAlias ();
+
+  // done
+  /**
+   * Create an entry in SyncLog and SyncStateNodes corresponding to the current state of SyncNodes
+   */
+  HashPtr
+  RememberStateInStateLog ();
+
+  // done
+  sqlite3_int64
+  LookupSyncLog (const std::string &stateHash);
+
+  // done
+  sqlite3_int64
+  LookupSyncLog (const Hash &stateHash);
+
+  // How difference is exposed will be determined later by the actual protocol
+  SyncStateMsgPtr
+  FindStateDifferences (const std::string &oldHash, const std::string &newHash);
+
+  SyncStateMsgPtr
+  FindStateDifferences (const Hash &oldHash, const Hash &newHash);  
+};
+
 
 #endif // SYNC_LOG_H
diff --git a/src/sync-state.proto b/src/sync-state.proto
new file mode 100644
index 0000000..9ef5e33
--- /dev/null
+++ b/src/sync-state.proto
@@ -0,0 +1,24 @@
+// message Name
+// {
+//   repeated bytes comp = 1;
+// }
+
+message SyncState
+{
+  // required Name name = 1;
+  required string name = 1;
+
+  enum ActionType
+  {
+    UPDATE = 0;
+    DELETE = 1;
+  }
+  required ActionType type = 2;
+
+  optional uint64 seq = 3;
+}
+
+message SyncStateMsg
+{
+  repeated SyncState state = 1;
+}
diff --git a/waf b/waf
index 69fb819..a6859ac 100755
--- a/waf
+++ b/waf
Binary files differ
diff --git a/wscript b/wscript
index e35bc4c..cf5f8bf 100644
--- a/wscript
+++ b/wscript
@@ -11,11 +11,13 @@
     opt.add_option('--test', action='store_true',default=False,dest='_test',help='''build unit tests''')
     opt.add_option('--yes',action='store_true',default=False) # for autoconf/automake/make compatibility
 
-    opt.load('compiler_cxx boost ccnx protoc')
+    opt.load('compiler_cxx boost ccnx protoc ice_cxx')
 
 def configure(conf):
     conf.load("compiler_cxx")
 
+    conf.define ("CHRONOSHARE_VERSION", VERSION)
+
     conf.check_cfg(package='sqlite3', args=['--cflags', '--libs'], uselib_store='SQLITE3', mandatory=True)
 
     if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False):
@@ -50,6 +52,7 @@
       conf.define('_TEST', 1)
 
     conf.load('protoc')
+    conf.load('ice_cxx')
 
     conf.write_config_header('src/config.h')
 
@@ -79,13 +82,37 @@
           includes = ['include', ],
           )
 
-    chronoshare = bld (
-        target="tmp",
+    common = bld.objects (
+        target = "common",
+        features = ["cxx"],
+        source = ['src/hash-helper.cc',
+                  'src/chronoshare-client.ice',
+                  ],
+        use = 'BOOST',
+        includes = ['include', 'src'],
+        )
+
+
+    client = bld (
+        target="cs-client",
+        features=['cxx', 'cxxprogram'],
+        source = ['client/client.cc',
+                  ],
+        use = "BOOST CCNX SSL ICE common",
+        includes = ['include', 'src'],
+        )
+
+    daemon = bld (
+        target="cs-daemon",
         features=['cxx', 'cxxprogram'],
         # source = bld.path.ant_glob(['src/**/*.cc']),
-        source = ['src/main.cc',
-                  'src/sqlite-helper.cc',
-                  'src/hash-string-converter.cc'],
-        use = 'BOOST BOOST_IOSTREAMS BOOST_REGEX CCNX SSL SQLITE3',
+        source = ['daemon/daemon.cc',
+                  'daemon/notify-i.cc',
+                  'src/db-helper.cc',
+                  'src/sync-log.cc',
+                  'src/action-log.cc',
+                  'src/sync-state.proto',
+                  ],
+        use = "BOOST CCNX SSL SQLITE3 ICE common",
         includes = ['include', 'src'],
         )
