diff --git a/client/client.cc b/client/client.cc
index 8ab8013..df827ba 100644
--- a/client/client.cc
+++ b/client/client.cc
@@ -93,19 +93,13 @@
               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_atime, fileStats.st_mtime, fileStats.st_ctime,
                                       fileStats.st_mode);
                 }
               else
diff --git a/daemon/daemon.cc b/daemon/daemon.cc
index 97fee4f..5b953d3 100644
--- a/daemon/daemon.cc
+++ b/daemon/daemon.cc
@@ -25,6 +25,7 @@
 #include <Ice/Identity.h>
 
 #include "notify-i.h"
+#include <boost/make_shared.hpp>
 
 using namespace std;
 using namespace boost;
@@ -34,6 +35,12 @@
 
 class MyService : public Ice::Service
 {
+public:
+  MyService (ActionLogPtr actionLog)
+  : m_actionLog (actionLog)
+  {
+  }
+  
 protected:
   virtual bool start (int, char*[], int&)
   {
@@ -41,7 +48,7 @@
 
     Ice::Identity identity;
     identity.name="NotifyDaemon";
-    NotifyPtr servant=new NotifyI;
+    NotifyPtr servant=new NotifyI (m_actionLog);
     
     _adapter->add (servant, identity);
     
@@ -51,7 +58,8 @@
   }
   
 private:
-    Ice::ObjectAdapterPtr _adapter;  
+  Ice::ObjectAdapterPtr _adapter;
+  ActionLogPtr m_actionLog;
 };
 
 int
@@ -62,9 +70,9 @@
   try
     {
       // DbHelper db ("./", "/ndn/ucla.edu/alex");
-      ActionLog bla ("./", "/ndn/ucla.edu/alex");
+      ActionLogPtr actionLog = make_shared<ActionLog> ("./", "/ndn/ucla.edu/alex");
 
-      MyService svc;
+      MyService svc (actionLog);
       status = svc.main (argc, argv);
 
       // HashPtr hash = db.RememberStateInStateLog ();
diff --git a/daemon/notify-i.cc b/daemon/notify-i.cc
index 0f8b004..0994aa3 100644
--- a/daemon/notify-i.cc
+++ b/daemon/notify-i.cc
@@ -23,26 +23,35 @@
 #include <hash-helper.h>
 
 using namespace std;
+using namespace boost;
 
-// NotifyI::NotifyI (DbHelperPtr &db)
-//   : m_db (db)
-// {
-// }
+NotifyI::NotifyI (ActionLogPtr &actionLog)
+  : m_actionLog (actionLog)
+{
+}
 
 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::Long atime,
+                     ::Ice::Long mtime,
+                     ::Ice::Long 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;
+  cout << "updateFile " << filename << " with hash " << hash << endl;
+  try
+    {
+      m_actionLog->AddActionUpdate (filename, hash, atime, mtime, ctime, mode);
+
+      m_actionLog->RememberStateInStateLog ();
+    }
+  catch (const boost::exception &e)
+    {
+      cout << "ERRORR: " << *get_error_info<errmsg_info_str> (e) << endl;
+    }
 }
 
 void
@@ -50,16 +59,16 @@
                    const ::std::string &newFilename,
                    const ::Ice::Current&)
 {
-  // cout << "moveFile from " << oldFilename << " to " << newFilename << endl;
-  // m_db->AddActionMove (filename, oldFilename);
+  cout << "moveFile from " << oldFilename << " to " << newFilename << endl;
+  // m_actionLog->AddActionMove (oldFilename, newFilename);
 }
 
 void
 NotifyI::deleteFile (const ::std::string &filename,
                      const ::Ice::Current&)
 {
-  // m_db->AddActionDelete (filename, oldFilename);
-  
-  // cout << "deleteFile " << filename << endl;
+  cout << "deleteFile " << filename << endl;
+  m_actionLog->AddActionDelete (filename);  
+  m_actionLog->RememberStateInStateLog ();
 }
 
diff --git a/daemon/notify-i.h b/daemon/notify-i.h
index a2cea97..9fd7044 100644
--- a/daemon/notify-i.h
+++ b/daemon/notify-i.h
@@ -22,19 +22,20 @@
 #ifndef NOTIFY_I_H
 #define NOTIFY_I_H
 
+#include <action-log.h>
 #include <chronoshare-client.ice.h>
 
 class NotifyI : public ChronoshareClient::Notify
 {
 public:
-  // NotifyI (DbHelperPtr &db);
+  NotifyI (ActionLogPtr &actionLog);
   
   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::Long atime,
+              ::Ice::Long mtime,
+              ::Ice::Long ctime,
               ::Ice::Int mode,
               const ::Ice::Current& = ::Ice::Current());
 
@@ -48,7 +49,7 @@
               const ::Ice::Current& = ::Ice::Current());
 
 private:
-  // DbHelperPtr m_db;
+  ActionLogPtr m_actionLog;
 };
 
 #endif // NOTIFY_I_H
diff --git a/include/ccnx-wrapper.h b/include/ccnx-wrapper.h
index 90089e7..4801bc2 100644
--- a/include/ccnx-wrapper.h
+++ b/include/ccnx-wrapper.h
@@ -51,9 +51,8 @@
   static string
   extractName(const unsigned char *data, const ccn_indexbuf *comps);
 
-protected:
   Bytes
-  createContentObject(const string &name, const unsigned char *buf, size_t len, int freshness);
+  createContentObject(const string &name, const unsigned char *buf, size_t len, int freshness = 2147/* max value for ccnx*/);
 
   int
   putToCcnd (const Bytes &contentObject);
diff --git a/src/action-item.proto b/src/action-item.proto
new file mode 100644
index 0000000..6d50065
--- /dev/null
+++ b/src/action-item.proto
@@ -0,0 +1,22 @@
+message ActionItem
+{
+  enum ActionType
+  {
+    UPDATE = 0;
+    DELETE = 1;
+  }
+  required ActionType action = 3;
+
+  required string filename = 4;
+  required uint64 version = 5;
+  required uint32 timestamp = 6;
+
+  optional bytes  file_hash = 7;
+  optional uint32 atime = 8;
+  optional uint32 mtime = 9;
+  optional uint32 ctime = 10;
+  optional uint32 mode  = 11;
+
+  optional string parent_device_name = 12;
+  optional uint64 parent_seq_no = 13;
+}
diff --git a/src/action-log.cc b/src/action-log.cc
index cf5156a..41166e7 100644
--- a/src/action-log.cc
+++ b/src/action-log.cc
@@ -20,59 +20,213 @@
  */
 
 #include "action-log.h"
+#include <action-item.pb.h>
 
 using namespace boost;
 using namespace std;
 
 ActionLog::ActionLog (const std::string &path, const std::string &localName)
-  : SyncLog (path)
-  , m_localName (localName)
+  : SyncLog (path, localName)
 {
 }
 
+tuple<sqlite3_int64, sqlite3_int64, sqlite3_int64, string>
+ActionLog::GetExistingRecord (const std::string &filename)
+{
+  // check if something already exists
+  sqlite3_stmt *stmt;
+  int res = sqlite3_prepare_v2 (m_db, "SELECT a.version,a.device_id,a.seq_no,a.action,s.device_name "
+                                "FROM ActionLog a JOIN SyncNodes s ON s.device_id = a.device_id "
+                                "WHERE filename=? ORDER BY a.version DESC,a.device_id DESC LIMIT 1", -1, &stmt, 0);
+
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Some error with GetExistingRecord"));
+    }
+
+  // with parent with version number + 1
+  sqlite3_int64 version = 0;
+  sqlite3_int64 parent_device_id = -1;
+  sqlite3_int64 parent_seq_no = -1;
+  string parent_device_name;
+  
+  sqlite3_bind_text (stmt, 1, filename.c_str (), filename.size (), SQLITE_STATIC);
+  if (sqlite3_step (stmt) == SQLITE_ROW) 
+    {
+      version = sqlite3_column_int64 (stmt, 0) + 1;
+
+      if (sqlite3_column_int (stmt, 3) == 0) // prevent "linking" if the file was previously deleted
+        {
+          parent_device_id = sqlite3_column_int64 (stmt, 1);
+          parent_seq_no = sqlite3_column_int64 (stmt, 2);
+          parent_device_name = string(reinterpret_cast<const char*> (sqlite3_column_text (stmt, 4)));
+        }
+    }
+  
+  sqlite3_finalize (stmt);
+  return make_tuple (version, parent_device_id, parent_seq_no, parent_device_name);
+}
+
 // 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,
+                            time_t atime, time_t mtime, time_t ctime,
                             int mode)
 {
-  int res = sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0);
+  sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0);
+  
+  sqlite3_int64 seq_no = GetNextLocalSeqNo ();
+  sqlite3_int64 version = 0;
+  sqlite3_int64 parent_device_id = -1;
+  string        parent_device_name;
+  sqlite3_int64 parent_seq_no = -1;
 
-  // 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);
+  sqlite3_int64 action_time = time (0);
+  
+  tie (version, parent_device_id, parent_seq_no, parent_device_name) = GetExistingRecord (filename);
+  
+  sqlite3_stmt *stmt;
+  int res = sqlite3_prepare_v2 (m_db, "INSERT INTO ActionLog "
+                                "(device_id, seq_no, action, filename, version, action_timestamp, "
+                                "file_hash, file_atime, file_mtime, file_ctime, file_chmod, "
+                                "parent_device_id, parent_seq_no) "
+                                "VALUES (?, ?, ?, ?, ?, datetime(?, 'unixepoch'),"
+                                "        ?, datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), ?,"
+                                "        ?, ?);", -1, &stmt, 0);
 
-  // if (res != SQLITE_OK)
-  //   {
-  //     BOOST_THROW_EXCEPTION (Error::Db ()
-  //                            << errmsg_info_str ("Some error with AddActionUpdate"));
-  //   }
+  // cout << "INSERT INTO ActionLog "
+  //                               "(device_id, seq_no, action, filename, version, action_timestamp, "
+  //                               "file_hash, file_atime, file_mtime, file_ctime, file_chmod, "
+  //                               "parent_device_id, parent_seq_no) "
+  //                               "VALUES (?, ?, ?, ?, ?, datetime(?, 'unixepoch'),"
+  //                               "        ?, datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), datetime(?, 'unixepoch'), ?,"
+  //   "        ?, ?)" << endl;
+  
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str (sqlite3_errmsg (m_db))
+                             );
+                             // << errmsg_info_str ("Some error with prepare 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);
+  
+  sqlite3_bind_int64 (stmt, 1, m_localDeviceId);
+  sqlite3_bind_int64 (stmt, 2, seq_no);
+  sqlite3_bind_int   (stmt, 3, 0);
+  sqlite3_bind_text  (stmt, 4, filename.c_str (), filename.size (), SQLITE_TRANSIENT);
+  sqlite3_bind_int64 (stmt, 5, version);
+  sqlite3_bind_int64 (stmt, 6, action_time);
+  
+  sqlite3_bind_blob  (stmt, 7, hash.GetHash (), hash.GetHashBytes (), SQLITE_TRANSIENT);
+  
+  sqlite3_bind_int64 (stmt, 8, atime);
+  sqlite3_bind_int64 (stmt, 9, mtime);
+  sqlite3_bind_int64 (stmt, 10, ctime);
+  sqlite3_bind_int   (stmt, 11, mode);
 
-      
-  //   }
-  // else
-  //   {
-  //     // without parent
-      
-  //   }
+  if (parent_device_id > 0 && parent_seq_no > 0)
+    {
+      sqlite3_bind_int64 (stmt, 12, parent_device_id);
+      sqlite3_bind_int64 (stmt, 13, parent_seq_no);
+    }
+  else
+    {
+      sqlite3_bind_null (stmt, 12);
+      sqlite3_bind_null (stmt, 13);
+    }
+  
+  sqlite3_step (stmt);
 
-  res += sqlite3_exec (m_db, "END TRANSACTION;", 0,0,0);
+  // missing part: creating ContentObject for the action !!!
+
+  ActionItem item;
+  item.set_action (ActionItem::UPDATE);
+  item.set_filename (filename);
+  item.set_version (version);
+  item.set_timestamp (action_time);
+  item.set_file_hash (hash.GetHash (), hash.GetHashBytes ());
+  item.set_atime (atime);
+  item.set_mtime (mtime);
+  item.set_ctime (ctime);
+  item.set_mode (mode);
+
+  if (parent_device_id > 0 && parent_seq_no > 0)
+    {
+      item.set_parent_device_name (parent_device_name);
+      item.set_parent_seq_no (parent_seq_no);
+    }
+
+  // assign name to the action, serialize action, and create content object
+  
+  sqlite3_finalize (stmt); 
+                          
+  sqlite3_exec (m_db, "END TRANSACTION;", 0,0,0);
 }
 
 void
 ActionLog::AddActionMove (const std::string &oldFile, const std::string &newFile)
 {
+  // not supported yet
+  BOOST_THROW_EXCEPTION (Error::Db ()
+                         << errmsg_info_str ("Move operation is not yet supported"));
 }
 
 void
 ActionLog::AddActionDelete (const std::string &filename)
 {
+  sqlite3_exec (m_db, "BEGIN TRANSACTION;", 0,0,0);
+  
+  sqlite3_int64 version = 0;
+  sqlite3_int64 parent_device_id = -1;
+  string        parent_device_name;
+  sqlite3_int64 parent_seq_no = -1;
+
+  sqlite3_int64 action_time = time (0);
+  
+  tie (version, parent_device_id, parent_seq_no, parent_device_name) = GetExistingRecord (filename);
+  if (parent_device_id < 0) // no records exist or file was already deleted
+    {
+      sqlite3_exec (m_db, "END TRANSACTION;", 0,0,0);  
+      return;
+    }
+
+  sqlite3_int64 seq_no = GetNextLocalSeqNo ();
+
+  sqlite3_stmt *stmt;
+  sqlite3_prepare_v2 (m_db, "INSERT INTO ActionLog "
+                      "(device_id, seq_no, action, filename, version, action_timestamp, "
+                      "parent_device_id, parent_seq_no) "
+                      "VALUES (?, ?, ?, ?, ?, datetime(?, 'unixepoch'),"
+                      "        ?, ?)", -1, &stmt, 0);
+
+  sqlite3_bind_int64 (stmt, 1, m_localDeviceId);
+  sqlite3_bind_int64 (stmt, 2, seq_no);
+  sqlite3_bind_int   (stmt, 3, 1);
+  sqlite3_bind_text  (stmt, 4, filename.c_str (), filename.size (), SQLITE_TRANSIENT);
+  sqlite3_bind_int64 (stmt, 5, version);
+  sqlite3_bind_int64 (stmt, 6, action_time);
+
+  sqlite3_bind_int64 (stmt, 7, parent_device_id);
+  sqlite3_bind_int64 (stmt, 8, parent_seq_no);
+  
+  sqlite3_step (stmt);
+
+  // missing part: creating ContentObject for the action !!!
+
+  ActionItem item;
+  item.set_action (ActionItem::UPDATE);
+  item.set_filename (filename);
+  item.set_version (version);
+  item.set_timestamp (action_time);
+  item.set_parent_device_name (parent_device_name);
+  item.set_parent_seq_no (parent_seq_no);
+
+  // assign name to the action, serialize action, and create content object
+  
+  sqlite3_finalize (stmt); 
+  
+  sqlite3_exec (m_db, "END TRANSACTION;", 0,0,0);    
 }
diff --git a/src/action-log.h b/src/action-log.h
index 6827cba..1d63fb8 100644
--- a/src/action-log.h
+++ b/src/action-log.h
@@ -23,29 +23,33 @@
 #define ACTION_LOG_H
 
 #include "sync-log.h"
+#include <boost/tuple/tuple.hpp>
+
+class ActionLog;
+typedef boost::shared_ptr<ActionLog> ActionLogPtr;
 
 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);
+                   const Hash &hash,
+                   time_t atime, time_t mtime, time_t ctime,
+                   int mode);
 
   void
   AddActionMove (const std::string &oldFile, const std::string &newFile);
-
+  
   void
   AddActionDelete (const std::string &filename);
+
+private:
+  boost::tuple<sqlite3_int64, sqlite3_int64, sqlite3_int64, std::string>
+  GetExistingRecord (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
index be40c3e..e3bf8e2 100644
--- a/src/chronoshare-client.ice
+++ b/src/chronoshare-client.ice
@@ -25,7 +25,7 @@
   
   interface Notify 
   {
-    void updateFile (string filename, ["cpp:array"] HashBytes fileHash, string atime, string mtime, string ctime, int mode);
+    void updateFile (string filename, ["cpp:array"] HashBytes fileHash, long atime, long mtime, long ctime, int mode);
 
     void moveFile (string origFilename, string newFilename);
 
diff --git a/src/db-helper.cc b/src/db-helper.cc
index 9bd2d61..f0e78d0 100644
--- a/src/db-helper.cc
+++ b/src/db-helper.cc
@@ -106,13 +106,13 @@
     parent_device_id INTEGER,                                           \n\
     parent_seq_no    INTEGER,                                           \n\
                                                                         \n\
-    action_name	     TEXT NOT NULL,                                     \n\
-    action_content_object BLOB NOT NULL,                                \n\
+    action_name	     TEXT,                                              \n\
+    action_content_object BLOB,                                         \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\
+	REFERENCES ActionLog (device_id, seq_no)                        \n\
 	ON UPDATE RESTRICT                                              \n\
 	ON DELETE SET NULL                                              \n\
 );                                                                      \n\
diff --git a/src/sync-log.cc b/src/sync-log.cc
index 3e49c69..677904a 100644
--- a/src/sync-log.cc
+++ b/src/sync-log.cc
@@ -26,6 +26,53 @@
 using namespace boost;
 using namespace std;
 
+SyncLog::SyncLog (const std::string &path, const std::string &localName)
+  : DbHelper (path)
+  , m_localName (localName)
+{
+  SyncLog::RememberStateInStateLog ();
+
+  UpdateDeviceSeqno (localName, 0);
+  
+  sqlite3_stmt *stmt;
+  int res = sqlite3_prepare_v2 (m_db, "SELECT device_id, seq_no FROM SyncNodes WHERE device_name=?", -1, &stmt, 0);
+  sqlite3_bind_text (stmt, 1, m_localName.c_str (), m_localName.size (), SQLITE_STATIC);
+
+  if (sqlite3_step (stmt) == SQLITE_ROW)
+    {
+      m_localDeviceId = sqlite3_column_int64 (stmt, 0);
+    }
+  else
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Impossible thing in SyncLog::SyncLog"));
+    }
+  sqlite3_finalize (stmt);
+}
+
+
+sqlite3_int64
+SyncLog::GetNextLocalSeqNo ()
+{
+  sqlite3_stmt *stmt_seq;
+  sqlite3_prepare_v2 (m_db, "SELECT seq_no FROM SyncNodes WHERE device_id = ?", -1, &stmt_seq, 0);
+  sqlite3_bind_int64 (stmt_seq, 1, m_localDeviceId);
+
+  if (sqlite3_step (stmt_seq) != SQLITE_ROW)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Impossible thing in ActionLog::AddActionUpdate"));
+    }
+  
+  sqlite3_int64 seq_no = sqlite3_column_int64 (stmt_seq, 0) + 1; 
+  sqlite3_finalize (stmt_seq);
+
+  UpdateDeviceSeqNo (m_localDeviceId, seq_no);
+  
+  return seq_no;
+}
+
+
 HashPtr
 SyncLog::RememberStateInStateLog ()
 {
@@ -130,7 +177,7 @@
 }
 
 void
-SyncLog::UpdateDeviceSeqno (const std::string &name, uint64_t seqNo)
+SyncLog::UpdateDeviceSeqno (const std::string &name, sqlite3_int64 seqNo)
 {
   sqlite3_stmt *stmt;
   // update is performed using trigger
@@ -144,11 +191,32 @@
   if (res != SQLITE_OK)
     {
       BOOST_THROW_EXCEPTION (Error::Db ()
-                             << errmsg_info_str ("Some error with UpdateDeviceSeqno"));
+                             << errmsg_info_str ("Some error with UpdateDeviceSeqno (name)"));
     }
   sqlite3_finalize (stmt);
 }
 
+void
+SyncLog::UpdateDeviceSeqNo (sqlite3_int64 deviceId, sqlite3_int64 seqNo)
+{
+  sqlite3_stmt *stmt;
+  // update is performed using trigger
+  int res = sqlite3_prepare (m_db, "UPDATE SyncNodes SET seq_no=MAX(seq_no,?) WHERE device_id=?;", 
+                             -1, &stmt, 0);
+
+  res += sqlite3_bind_int64 (stmt, 1, seqNo);
+  res += sqlite3_bind_int64 (stmt, 2, deviceId);
+  sqlite3_step (stmt);
+  
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Some error with UpdateDeviceSeqNo (id)"));
+    }
+  sqlite3_finalize (stmt);
+}
+
+
 SyncStateMsgPtr
 SyncLog::FindStateDifferences (const std::string &oldHash, const std::string &newHash)
 {
diff --git a/src/sync-log.h b/src/sync-log.h
index 5705e45..bef41a7 100644
--- a/src/sync-log.h
+++ b/src/sync-log.h
@@ -30,14 +30,17 @@
 class SyncLog : public DbHelper
 {
 public:
-  SyncLog (const std::string &path)
-    : DbHelper (path)
-  {
-  }
+  SyncLog (const std::string &path, const std::string &localName);
 
+  sqlite3_int64
+  GetNextLocalSeqNo (); // side effect: local seq_no will be increased
+
+  void
+  UpdateDeviceSeqNo (sqlite3_int64 deviceId, sqlite3_int64 seqNo);
+  
   // done
   void
-  UpdateDeviceSeqno (const std::string &name, uint64_t seqNo);
+  UpdateDeviceSeqno (const std::string &name, sqlite3_int64 seqNo);
 
   // std::string
   // LookupForwardingAlias (const std::string &deviceName);
@@ -66,6 +69,11 @@
 
   SyncStateMsgPtr
   FindStateDifferences (const Hash &oldHash, const Hash &newHash);  
+
+protected:
+  std::string m_localName;
+  sqlite3_int64 m_localDeviceId;
+  
 };
 
 
diff --git a/wscript b/wscript
index cf5f8bf..7ce0339 100644
--- a/wscript
+++ b/wscript
@@ -112,6 +112,7 @@
                   'src/sync-log.cc',
                   'src/action-log.cc',
                   'src/sync-state.proto',
+                  'src/action-item.proto',
                   ],
         use = "BOOST CCNX SSL SQLITE3 ICE common",
         includes = ['include', 'src'],
