diff --git a/src/hash-string-converter.cc b/src/hash-string-converter.cc
new file mode 100644
index 0000000..1c9a656
--- /dev/null
+++ b/src/hash-string-converter.cc
@@ -0,0 +1,129 @@
+/* -*- 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 "hash-string-converter.h"
+
+#include <boost/assert.hpp>
+#include <boost/throw_exception.hpp>
+#include <boost/make_shared.hpp>
+#include <openssl/evp.h>
+
+typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str; 
+typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int; 
+
+#include <boost/archive/iterators/transform_width.hpp>
+#include <boost/iterator/transform_iterator.hpp>
+#include <boost/archive/iterators/dataflow_exception.hpp>
+
+using namespace boost;
+using namespace boost::archive::iterators;
+using namespace std;
+
+
+template<class CharType>
+struct hex_from_4_bit
+{
+  typedef CharType result_type;
+  CharType operator () (CharType ch) const
+  {
+    const char *lookup_table = "0123456789abcdef";
+    // cout << "New character: " << (int) ch << " (" << (char) ch << ")" << "\n";
+    BOOST_ASSERT (ch < 16);
+    return lookup_table[static_cast<size_t>(ch)];
+  }
+};
+
+typedef transform_iterator<hex_from_4_bit<string::const_iterator::value_type>,
+                           transform_width<string::const_iterator, 4, 8, string::const_iterator::value_type> > string_from_binary;
+
+
+template<class CharType>
+struct hex_to_4_bit
+{
+  typedef CharType result_type;
+  CharType operator () (CharType ch) const
+  {
+    const signed char lookup_table [] = {
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1,
+      -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+      -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
+    };
+
+    // cout << "New character: " << hex << (int) ch << " (" << (char) ch << ")" << "\n";
+    signed char value = -1;
+    if ((unsigned)ch < 128)
+      value = lookup_table [(unsigned)ch];
+    if (value == -1)
+      BOOST_THROW_EXCEPTION (Error::HashConversion () << errmsg_info_int ((int)ch));
+    
+    return value;
+  }
+};
+
+typedef transform_width<transform_iterator<hex_to_4_bit<string::const_iterator::value_type>, string::const_iterator>, 8, 4> string_to_binary;
+
+
+std::ostream &
+operator << (std::ostream &os, const Hash &hash)
+{
+  if (hash.m_length == 0)
+    return os;
+
+  ostreambuf_iterator<char> out_it (os); // ostream iterator
+  // need to encode to base64
+  copy (string_from_binary (reinterpret_cast<const char*> (hash.m_buf)),
+        string_from_binary (reinterpret_cast<const char*> (hash.m_buf+hash.m_length)),
+        out_it);
+
+  return os;
+}
+
+Hash::Hash (const std::string &hashInTextEncoding)
+{
+  if (hashInTextEncoding.size () == 0)
+    {
+      m_buf = 0;
+      m_length = 0;
+      return;
+    }
+
+  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;
+    }
+
+  unsigned char *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);
+
+  m_length = end-m_buf;
+}
+
diff --git a/src/hash-string-converter.h b/src/hash-string-converter.h
new file mode 100644
index 0000000..1a84065
--- /dev/null
+++ b/src/hash-string-converter.h
@@ -0,0 +1,93 @@
+/* -*- 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 HASH_STRING_CONVERTER_H
+#define HASH_STRING_CONVERTER_H
+
+#include <string.h>
+#include <iostream>
+#include <boost/shared_ptr.hpp>
+#include <boost/exception/all.hpp>
+
+class Hash
+{
+public:
+  Hash (const void *buf, size_t length)
+    : m_length (length)
+  {
+    m_buf = new unsigned char [length];
+    memcpy (m_buf, buf, length);
+  }
+
+  Hash (const std::string &hashInTextEncoding);
+
+  ~Hash ()
+  {
+    delete [] m_buf;
+  }
+  
+  bool
+  IsZero () const
+  {
+    return m_length == 0 ||
+      (m_length == 1 && m_buf[0] == 0);
+  }
+
+  bool
+  operator == (const Hash &otherHash) const
+  {
+    if (m_length != otherHash.m_length)
+      return false;
+    
+    return memcmp (m_buf, otherHash.m_buf, m_length) == 0;
+  }
+
+  const void *
+  GetHash () const
+  {
+    return m_buf;
+  }
+
+  size_t
+  GetHashBytes () const
+  {
+    return m_length;
+  }
+  
+private:
+  unsigned char *m_buf;
+  size_t m_length;
+
+  friend std::ostream &
+  operator << (std::ostream &os, const Hash &digest);
+};
+
+namespace Error {
+struct HashConversion : virtual boost::exception, virtual std::exception { };
+}
+
+typedef boost::shared_ptr<Hash> HashPtr;
+
+
+std::ostream &
+operator << (std::ostream &os, const Hash &digest);
+
+#endif // HASH_STRING_CONVERTER_H
diff --git a/src/sqlite-helper.cc b/src/sqlite-helper.cc
index c9c508b..7f3d829 100644
--- a/src/sqlite-helper.cc
+++ b/src/sqlite-helper.cc
@@ -21,6 +21,7 @@
 
 #include "sqlite-helper.h"
 // #include "sync-log.h"
+#include "hash-string-converter.h"
 
 // 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
@@ -44,23 +45,24 @@
 CREATE INDEX SyncNodes_device_name ON SyncNodes (device_name);  \
                                                                 \
 CREATE TABLE SyncLog(                                           \
-        state_hash  BLOB NOT NULL PRIMARY KEY,                  \
+        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_hash  BLOB NOT NULL                                       \
-            REFERENCES SyncLog (state_hash) ON UPDATE CASCADE ON DELETE CASCADE, \
+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_hash ON SyncStateNodes (state_hash);  \
-CREATE INDEX SyncStateNodes_seq_no ON SyncStateNodes (seq_no);          \
+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                                            \
@@ -96,14 +98,6 @@
 
   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);
-  //   }
-
-  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",
-                          NULL, NULL, &errmsg);
   if (res != SQLITE_OK && errmsg != 0)
     {
       std::cerr << "DEBUG: " << errmsg << std::endl;
@@ -121,6 +115,34 @@
 }
 
 void
+DbHelper::rememberStateInStateLog ()
+{
+  char *errmsg = 0;
+  int res = sqlite3_exec (m_db, " \
+BEGIN TRANSACTION;                              \
+INSERT INTO SyncLog                             \
+    (state_hash, last_update)                   \
+    SELECT                                              \
+       hash(device_name, seq_no), datetime('now')       \
+    FROM SyncNodes                                      \
+    ORDER BY device_name;                               \
+                                                        \
+INSERT INTO SyncStateNodes                              \
+      (state_id, device_id, seq_no)                     \
+      SELECT last_insert_rowid(), device_id, seq_no     \
+            FROM SyncNodes;                             \
+COMMIT;                                                 \
+",
+                          NULL, NULL, &errmsg);
+  if (res != SQLITE_OK && errmsg != 0)
+    {
+      std::cerr << "DEBUG: " << errmsg << std::endl;
+      sqlite3_free (errmsg);
+    }
+}
+
+
+void
 DbHelper::hash_xStep (sqlite3_context *context, int argc, sqlite3_value **argv)
 {
   if (argc != 2)
@@ -172,7 +194,8 @@
 
   if (*hash_context == 0) // no rows
     {
-      sqlite3_result_null (context);
+      char charNullResult = 0;
+      sqlite3_result_blob (context, &charNullResult, 1, SQLITE_TRANSIENT); //SQLITE_TRANSIENT forces to make a copy
       return;
     }
   
@@ -187,3 +210,37 @@
   
   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;
+  os << Hash (hash, hashBytes);
+  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);
+}
+
diff --git a/src/sqlite-helper.h b/src/sqlite-helper.h
index 6874259..b710646 100644
--- a/src/sqlite-helper.h
+++ b/src/sqlite-helper.h
@@ -35,14 +35,33 @@
   DbHelper (const std::string &path);
   ~DbHelper ();
 
-  
-  
+  void
+  updateDeviceSeqno ();
+
+  std::string
+  LookupForwardingAlias (const std::string &deviceName);
+
+  void
+  updateForwardingAlias ();
+
+  /**
+   * Create an entry in SyncLog and SyncStateNodes corresponding to the current state of SyncNodes
+   */
+  void
+  rememberStateInStateLog ();
+
 private:
   static void
-  hash_xStep (sqlite3_context*,int,sqlite3_value**);
+  hash_xStep (sqlite3_context *context, int argc, sqlite3_value **argv);
 
   static void
-  hash_xFinal (sqlite3_context*);
+  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;
