diff --git a/filesystemwatcher/filesystemwatcher.cpp b/filesystemwatcher/filesystemwatcher.cpp
deleted file mode 100644
index b887292..0000000
--- a/filesystemwatcher/filesystemwatcher.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-/* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
- */
-
-#include "filesystemwatcher.h"
-
-FileSystemWatcher::FileSystemWatcher(QString dirPath, QObject* parent) :
-    QObject(parent),
-    m_watcher(new QFileSystemWatcher()),
-    m_timer(new QTimer()),
-    m_dirPath(dirPath)
-{
-    // add main directory to monitor
-    m_watcher->addPath(m_dirPath);
-
-    // register signals (callback functions)
-    connect(m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(watcherCallbackSlot(QString)));
-    connect(m_timer, SIGNAL(timeout()), this, SLOT(timerCallbackSlot()));
-
-    // bootstrap
-    QTimer::singleShot(1000, this, SLOT(bootstrap()));
-
-    // start timer
-    m_timer->start(300000);
-}
-
-FileSystemWatcher::~FileSystemWatcher()
-{
-    // clean up
-    delete m_watcher;
-    delete m_timer;
-}
-
-void FileSystemWatcher::bootstrap()
-{
-    // bootstrap specific steps
-#if DEBUG
-    qDebug() << endl << "[BOOTSTRAP]";
-#endif
-    timerCallbackSlot();
-#if DEBUG
-    qDebug() << endl << "[\\BOOTSTRAP]";
-#endif
-}
-
-void FileSystemWatcher::watcherCallbackSlot(QString dirPath)
-{
-    // watcher specific steps
-#if DEBUG
-    qDebug() << endl << "[WATCHER] Triggered Path: " << dirPath;
-#endif
-    handleCallback(dirPath);
-}
-
-void FileSystemWatcher::timerCallbackSlot()
-{
-    // timer specific steps
-#if DEBUG
-    qDebug() << endl << "[TIMER] Triggered Path: " << m_dirPath;
-#endif
-    handleCallback(m_dirPath);
-}
-
-void FileSystemWatcher::handleCallback(QString dirPath)
-{
-    // scan directory and populate file list
-    QHash<QString, qint64> currentState = scanDirectory(dirPath);
-
-    // reconcile directory and report changes
-    std::vector<sEventInfo> dirChanges = reconcileDirectory(currentState, dirPath);
-#if DEBUG
-    // DEBUG: Print Changes
-    printChanges(dirChanges);
-#endif
-    // emit the signal if not empty
-    if(!dirChanges.empty())
-        emit dirEventSignal(dirChanges);
-}
-
-QHash<QString, qint64> FileSystemWatcher::scanDirectory(QString dirPath)
-{   
-    // list of files in directory
-    QHash<QString, qint64> currentState;
-
-    // directory iterator (recursive)
-    QDirIterator dirIterator(dirPath, QDirIterator::Subdirectories |
-                                        QDirIterator::FollowSymlinks);
-
-    // iterate through directory recursively
-    while(dirIterator.hasNext())
-    {
-        // Get Next File/Dir
-        dirIterator.next();
-
-        // Get FileInfo
-        QFileInfo fileInfo = dirIterator.fileInfo();
-
-        // if not this directory or previous directory
-        if(fileInfo.absoluteFilePath() != ".." && fileInfo.absoluteFilePath() != ".")
-        {
-            QString absFilePath = fileInfo.absoluteFilePath();
-
-            // if this is a directory
-            if(fileInfo.isDir())
-            {
-                QStringList dirList = m_watcher->directories();
-
-                // if the directory is not already being watched
-                if (absFilePath.startsWith(m_dirPath) && !dirList.contains(absFilePath))
-                {
-                    // add this directory to the watch list
-                    m_watcher->addPath(absFilePath);
-                }
-            }
-            else
-            {
-                // add this file to the file list
-                currentState.insert(absFilePath, fileInfo.created().toMSecsSinceEpoch());
-            }
-        }
-    }
-
-    return currentState;
-}
-
-std::vector<sEventInfo> FileSystemWatcher::reconcileDirectory(QHash<QString, qint64> currentState, QString dirPath)
-{
-    // list of files changed
-    std::vector<sEventInfo> dirChanges;
-
-    // compare result (database/stored snapshot) to fileList (current snapshot)
-    QMutableHashIterator<QString, qint64> i(m_storedState);
-
-    while(i.hasNext())
-    {
-        i.next();
-
-        QString absFilePath = i.key();
-        qint64 storedCreated = i.value();
-
-        // if this file is in a level higher than
-        // this directory, ignore
-        if(!absFilePath.startsWith(dirPath))
-        {
-            continue;
-        }
-
-        // check file existence
-        if(currentState.contains(absFilePath))
-        {
-            qint64 currentCreated = currentState.value(absFilePath);
-
-            if(storedCreated != currentCreated)
-            {
-                // update stored state
-                i.setValue(currentCreated);
-
-                // this file has been modified
-                sEventInfo eventInfo;
-                eventInfo.event = MODIFIED;
-                eventInfo.absFilePath = absFilePath.toStdString();
-                dirChanges.push_back(eventInfo);
-            }
-
-            // delete this file from fileList we have processed it
-            currentState.remove(absFilePath);
-        }
-        else
-        {
-            // delete from stored state
-            i.remove();
-
-            // this file has been deleted
-            sEventInfo eventInfo;
-            eventInfo.event = DELETED;
-            eventInfo.absFilePath = absFilePath.toStdString();
-            dirChanges.push_back(eventInfo);
-        }
-    }
-
-    // any files left in fileList have been added
-    for(QHash<QString, qint64>::iterator i = currentState.begin(); i != currentState.end(); ++i)
-    {
-        QString absFilePath = i.key();
-        qint64 currentCreated = i.value();
-
-        m_storedState.insert(absFilePath, currentCreated);
-
-        // this file has been added
-        sEventInfo eventInfo;
-        eventInfo.event = ADDED;
-        eventInfo.absFilePath = absFilePath.toStdString();
-        dirChanges.push_back(eventInfo);
-    }
-
-    return dirChanges;
-}
-
-QByteArray FileSystemWatcher::calcChecksum(QString absFilePath)
-{
-    // initialize checksum
-    QCryptographicHash crypto(QCryptographicHash::Md5);
-
-    // open file
-    QFile file(absFilePath);
-    file.open(QFile::ReadOnly);
-
-    // calculate checksum
-    while(!file.atEnd())
-    {
-        crypto.addData(file.read(8192));
-    }
-
-    return crypto.result();
-}
-
-void FileSystemWatcher::printChanges(std::vector<sEventInfo> dirChanges)
-{
-    if(!dirChanges.empty())
-    {
-        for(size_t i = 0; i < dirChanges.size(); i++)
-        {
-            QString tempString;
-
-            eEvent event = dirChanges[i].event;
-            QString absFilePath = QString::fromStdString(dirChanges[i].absFilePath);
-
-            switch(event)
-            {
-            case ADDED:
-                tempString.append("ADDED: ");
-                break;
-            case MODIFIED:
-                tempString.append("MODIFIED: ");
-                break;
-            case DELETED:
-                tempString.append("DELETED: ");
-                break;
-            }
-
-            tempString.append(absFilePath);
-
-            qDebug() << "\t" << tempString;
-        }
-    }
-    else
-    {
-        qDebug() << "\t[EMPTY]";
-    }
-}
-
-#if WAF
-#include "filesystemwatcher.moc"
-#include "filesystemwatcher.cpp.moc"
-#endif
diff --git a/filesystemwatcher/filesystemwatcher.h b/filesystemwatcher/filesystemwatcher.h
deleted file mode 100644
index 543fba6..0000000
--- a/filesystemwatcher/filesystemwatcher.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
- */
-#ifndef FILESYSTEMWATCHER_H
-#define FILESYSTEMWATCHER_H
-
-#include <QFileSystemWatcher>
-#include <QCryptographicHash>
-#include <QDirIterator>
-#include <QFileInfo>
-#include <QDateTime>
-#include <QTimer>
-#include <QDebug>
-#include <QHash>
-#include <structs.h>
-
-#define DEBUG 1
-
-class FileSystemWatcher : public QObject
-{
-    Q_OBJECT
-
-public:
-    // constructor
-    FileSystemWatcher(QString dirPath, QObject* parent = 0);
-
-    // destructor
-    ~FileSystemWatcher();
-
-signals:
-    // directory event signal
-    void dirEventSignal(std::vector<sEventInfo> dirChanges);
-
-private slots:
-    // handle callback from watcher
-    void watcherCallbackSlot(QString dirPath);
-
-    // handle callback from timer
-    void timerCallbackSlot();
-
-    // bootstrap
-    void bootstrap();
-
-private:
-    // handle callback from either the watcher or timer
-    void handleCallback(QString dirPath);
-
-    // scan directory and populate file list
-    QHash<QString, qint64> scanDirectory(QString dirPath);
-
-    // reconcile directory, find changes
-    std::vector<sEventInfo> reconcileDirectory(QHash<QString, qint64> fileList, QString dirPath);
-
-    // calculate checksum
-    QByteArray calcChecksum(QString absFilePath);
-
-    // print Changes (DEBUG)
-    void printChanges(std::vector<sEventInfo> dirChanges);
-
-private:
-    QFileSystemWatcher* m_watcher; // filesystem watcher
-    QTimer* m_timer; // timer
-
-    QString m_dirPath; // monitored path
-    QHash<QString, qint64> m_storedState; // stored state of directory
-};
-
-#endif // FILESYSTEMWATCHER_H
diff --git a/filesystemwatcher/main.cpp b/filesystemwatcher/main.cpp
deleted file mode 100644
index 213a27e..0000000
--- a/filesystemwatcher/main.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
- */
-
-#include "filesystemwatcher.h"
-#include "simpleeventcatcher.h"
-#include <QApplication>
-#include <iostream>
-
-int main(int argc, char *argv[])
-{
-    QApplication app(argc, argv);
-
-    // invoke file system watcher on specified path
-    FileSystemWatcher watcher("/Users/jared/Desktop");
-
-    // class that will utilize these signals
-    SimpleEventCatcher dirEventCatcher(&watcher);
-
-    return app.exec();
-}
diff --git a/filesystemwatcher/simpleeventcatcher.cpp b/filesystemwatcher/simpleeventcatcher.cpp
deleted file mode 100644
index f1061fb..0000000
--- a/filesystemwatcher/simpleeventcatcher.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
- */
-
-#include "simpleeventcatcher.h"
-
-SimpleEventCatcher::SimpleEventCatcher(FileSystemWatcher* watcher, QObject *parent) :
-    QObject(parent)
-{
-    // register for directory event signal (callback function)
-    QObject::connect(watcher, SIGNAL(dirEventSignal(std::vector<sEventInfo>)), this, SLOT(handleDirEvent(std::vector<sEventInfo>)));
-}
-
-void SimpleEventCatcher::handleDirEvent(std::vector<sEventInfo> dirChanges)
-{
-    qDebug() << endl << "[SIGNAL] From SimpleEventCatcher Slot:";
-
-    if(!dirChanges.empty())
-    {
-        for(size_t i = 0; i < dirChanges.size(); i++)
-        {
-            QString tempString;
-
-            eEvent event = dirChanges[i].event;
-            QString absFilePath = QString::fromStdString(dirChanges[i].absFilePath);
-
-            switch(event)
-            {
-            case ADDED:
-                tempString.append("ADDED: ");
-                break;
-            case MODIFIED:
-                tempString.append("MODIFIED: ");
-                break;
-            case DELETED:
-                tempString.append("DELETED: ");
-                break;
-            }
-
-            tempString.append(absFilePath);
-
-            qDebug() << "\t" << tempString;
-        }
-    }
-    else
-    {
-        qDebug() << "\t[EMPTY]";
-    }
-}
-
-#if WAF
-#include "simpleeventcatcher.moc"
-#include "simpleeventcatcher.cpp.moc"
-#endif
diff --git a/filesystemwatcher/simpleeventcatcher.h b/filesystemwatcher/simpleeventcatcher.h
deleted file mode 100644
index 2a858fd..0000000
--- a/filesystemwatcher/simpleeventcatcher.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
- */
-
-#ifndef SIMPLEEVENTCATCHER_H
-#define SIMPLEEVENTCATCHER_H
-
-#include "filesystemwatcher.h"
-#include <QObject>
-#include <QDebug>
-#include <vector>
-#include <structs.h>
-
-class SimpleEventCatcher : public QObject
-{
-    Q_OBJECT
-public:
-    explicit SimpleEventCatcher(FileSystemWatcher* watcher, QObject *parent = 0);
-
-public slots:
-    // handle signal
-    void handleDirEvent(std::vector<sEventInfo> dirChanges);
-};
-
-#endif // SIMPLEEVENTCATCHER_H
diff --git a/filesystemwatcher/README.md b/fs-watcher/README.md
similarity index 100%
rename from filesystemwatcher/README.md
rename to fs-watcher/README.md
diff --git a/fs-watcher/fs-watcher.cc b/fs-watcher/fs-watcher.cc
new file mode 100644
index 0000000..cdbff3c
--- /dev/null
+++ b/fs-watcher/fs-watcher.cc
@@ -0,0 +1,276 @@
+/* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#include "fs-watcher.h"
+#include "logging.h"
+
+#include <boost/bind.hpp>
+
+#include <QDirIterator>
+#include <QRegExp>
+
+using namespace std;
+using namespace boost;
+
+INIT_LOGGER ("FsWatcher");
+
+FsWatcher::FsWatcher (QString dirPath, QObject* parent)
+  : QObject(parent)
+  , m_watcher (new QFileSystemWatcher())
+  , m_executor (1)
+  , m_dirPath (dirPath)
+{
+  _LOG_DEBUG ("Monitor dir: " << m_dirPath.toStdString ());
+  // add main directory to monitor
+  m_watcher->addPath (m_dirPath);
+
+  // register signals (callback functions)
+  connect (m_watcher, SIGNAL (directoryChanged (QString)), this, SLOT (DidDirectoryChanged (QString)));
+  connect (m_watcher, SIGNAL (fileChanged (QString)),      this, SLOT (DidFileChanged (QString)));
+
+  m_executor.execute (bind (&FsWatcher::ScanDirectory_Notify_Execute, this, m_dirPath));
+}
+
+FsWatcher::~FsWatcher()
+{
+  delete m_watcher;
+}
+
+void
+FsWatcher::DidDirectoryChanged (QString dirPath)
+{
+  _LOG_DEBUG ("Triggered DirPath: " << dirPath.toStdString ());
+
+  m_executor.execute (bind (&FsWatcher::ScanDirectory_Notify_Execute, this, dirPath));
+}
+
+void
+FsWatcher::DidFileChanged (QString filePath)
+{
+  _LOG_DEBUG ("Triggered FilePath: " << filePath.toStdString ());
+}
+
+
+void FsWatcher::DidDirectoryChanged_Execute (QString dirPath)
+{
+//   // scan directory and populate file list
+//   QHash<QString, qint64> currentState = scanDirectory(dirPath);
+
+//   // reconcile directory and report changes
+//   std::vector<sEventInfo> dirChanges = reconcileDirectory(currentState, dirPath);
+// #ifdef _DEBUG
+//   // DEBUG: Print Changes
+//   printChanges(dirChanges);
+// #endif
+//   // emit the signal if not empty
+//   if(!dirChanges.empty())
+//     emit dirEventSignal(dirChanges);
+}
+
+void
+FsWatcher::ScanDirectory_Notify_Execute (QString dirPath)
+{
+  QRegExp exclude ("^(\\.|\\.\\.|\\.chronoshare)$");
+
+  QDirIterator dirIterator (dirPath,
+                            QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoSymLinks | QDir::NoDotAndDotDot,
+                            QDirIterator::Subdirectories); // directory iterator (recursive)
+
+  // iterate through directory recursively
+  while (dirIterator.hasNext ())
+    {
+      dirIterator.next ();
+
+      // Get FileInfo
+      QFileInfo fileInfo = dirIterator.fileInfo ();
+
+      QString name = fileInfo.fileName ();
+
+      if (!exclude.exactMatch (name))
+        {
+          // _LOG_DEBUG ("Not excluded file/dir: " << fileInfo.absoluteFilePath ().toStdString ());
+          QString absFilePath = fileInfo.absoluteFilePath ();
+
+          // _LOG_DEBUG ("Attempt to add path to watcher: " << absFilePath.toStdString ());
+          m_watcher->addPath (absFilePath);
+
+          if (fileInfo.isFile ())
+            {
+              DidFileChanged (absFilePath);
+            }
+          // // if this is a directory
+          // if(fileInfo.isDir())
+          //   {
+          //     QStringList dirList = m_watcher->directories();
+
+          //     // if the directory is not already being watched
+          //     if (absFilePath.startsWith(m_dirPath) && !dirList.contains(absFilePath))
+          //       {
+          //         _LOG_DEBUG ("Add new dir to watchlist: " << absFilePath.toStdString ());
+          //         // add this directory to the watch list
+          //         m_watcher->addPath(absFilePath);
+          //       }
+          //   }
+          // else
+          //   {
+          //     _LOG_DEBUG ("Found file: " << absFilePath.toStdString ());
+          //     // add this file to the file list
+          //     // currentState.insert(absFilePath, fileInfo.created().toMSecsSinceEpoch());
+          //   }
+        }
+      else
+        {
+          // _LOG_DEBUG ("Excluded file/dir: " << fileInfo.filePath ().toStdString ());
+        }
+    }
+}
+
+// std::vector<sEventInfo> FsWatcher::reconcileDirectory(QHash<QString, qint64> currentState, QString dirPath)
+// {
+//   // list of files changed
+//   std::vector<sEventInfo> dirChanges;
+
+//   // compare result (database/stored snapshot) to fileList (current snapshot)
+//   QMutableHashIterator<QString, qint64> i(m_storedState);
+
+//   while(i.hasNext())
+//     {
+//       i.next();
+
+//       QString absFilePath = i.key();
+//       qint64 storedCreated = i.value();
+
+//       // if this file is in a level higher than
+//       // this directory, ignore
+//       if(!absFilePath.startsWith(dirPath))
+//         {
+//           continue;
+//         }
+
+//       // check file existence
+//       if(currentState.contains(absFilePath))
+//         {
+//           qint64 currentCreated = currentState.value(absFilePath);
+
+//           if(storedCreated != currentCreated)
+//             {
+//               // update stored state
+//               i.setValue(currentCreated);
+
+//               // this file has been modified
+//               sEventInfo eventInfo;
+//               eventInfo.event = MODIFIED;
+//               eventInfo.absFilePath = absFilePath.toStdString();
+//               dirChanges.push_back(eventInfo);
+//             }
+
+//           // delete this file from fileList we have processed it
+//           currentState.remove(absFilePath);
+//         }
+//       else
+//         {
+//           // delete from stored state
+//           i.remove();
+
+//           // this file has been deleted
+//           sEventInfo eventInfo;
+//           eventInfo.event = DELETED;
+//           eventInfo.absFilePath = absFilePath.toStdString();
+//           dirChanges.push_back(eventInfo);
+//         }
+//     }
+
+//   // any files left in fileList have been added
+//   for(QHash<QString, qint64>::iterator i = currentState.begin(); i != currentState.end(); ++i)
+//     {
+//       QString absFilePath = i.key();
+//       qint64 currentCreated = i.value();
+
+//       m_storedState.insert(absFilePath, currentCreated);
+
+//       // this file has been added
+//       sEventInfo eventInfo;
+//       eventInfo.event = ADDED;
+//       eventInfo.absFilePath = absFilePath.toStdString();
+//       dirChanges.push_back(eventInfo);
+//     }
+
+//   return dirChanges;
+// }
+
+// QByteArray FsWatcher::calcChecksum(QString absFilePath)
+// {
+//   // initialize checksum
+//   QCryptographicHash crypto(QCryptographicHash::Md5);
+
+//   // open file
+//   QFile file(absFilePath);
+//   file.open(QFile::ReadOnly);
+
+//   // calculate checksum
+//   while(!file.atEnd())
+//     {
+//       crypto.addData(file.read(8192));
+//     }
+
+//   return crypto.result();
+// }
+
+// void FsWatcher::printChanges(std::vector<sEventInfo> dirChanges)
+// {
+//   if(!dirChanges.empty())
+//     {
+//       for(size_t i = 0; i < dirChanges.size(); i++)
+//         {
+//           QString tempString;
+
+//           eEvent event = dirChanges[i].event;
+//           QString absFilePath = QString::fromStdString(dirChanges[i].absFilePath);
+
+//           switch(event)
+//             {
+//             case ADDED:
+//               tempString.append("ADDED: ");
+//               break;
+//             case MODIFIED:
+//               tempString.append("MODIFIED: ");
+//               break;
+//             case DELETED:
+//               tempString.append("DELETED: ");
+//               break;
+//             }
+
+//           tempString.append(absFilePath);
+
+//           _LOG_DEBUG ("\t" << tempString.toStdString ());
+//         }
+//     }
+//   else
+//     {
+//           _LOG_DEBUG ("\t[EMPTY]");
+//     }
+// }
+
+#if WAF
+#include "fs-watcher.moc"
+#include "fs-watcher.cc.moc"
+#endif
diff --git a/fs-watcher/fs-watcher.h b/fs-watcher/fs-watcher.h
new file mode 100644
index 0000000..278a630
--- /dev/null
+++ b/fs-watcher/fs-watcher.h
@@ -0,0 +1,81 @@
+/* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *         Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+#ifndef FS_WATCHER_H
+#define FS_WATCHER_H
+
+#include <vector>
+#include <QFileSystemWatcher>
+
+#include "structs.h"
+
+#include "executor.h"
+
+class FsWatcher : public QObject
+{
+  Q_OBJECT
+
+public:
+  // constructor
+  FsWatcher (QString dirPath, QObject* parent = 0);
+
+  // destructor
+  ~FsWatcher ();
+
+private slots:
+  // handle callback from watcher
+  void
+  DidDirectoryChanged (QString dirPath);
+
+  /**
+   * @brief This even will be triggered either by actual file change or via directory change event
+   * (i.e., can happen twice in a row, as well as trigger false alarm)
+   */
+  void
+  DidFileChanged (QString filePath);
+
+private:
+  // handle callback from the watcher
+  void
+  DidDirectoryChanged_Execute (QString dirPath);
+
+  // scan directory and notify callback about any file changes
+  void
+  ScanDirectory_Notify_Execute (QString dirPath);
+
+  // // reconcile directory, find changes
+  // std::vector<sEventInfo>
+  // reconcileDirectory (QHash<QString, qint64> fileList, QString dirPath);
+
+  // // calculate checksum
+  // QByteArray calcChecksum(QString absFilePath);
+
+  // // print Changes (DEBUG)
+  // void printChanges(std::vector<sEventInfo> dirChanges);
+
+private:
+  QFileSystemWatcher* m_watcher; // filesystem watcher
+  Executor m_executor;
+
+  QString m_dirPath; // monitored path
+};
+
+#endif // FILESYSTEMWATCHER_H
diff --git a/fs-watcher/simpleeventcatcher.cpp b/fs-watcher/simpleeventcatcher.cpp
new file mode 100644
index 0000000..610903c
--- /dev/null
+++ b/fs-watcher/simpleeventcatcher.cpp
@@ -0,0 +1,70 @@
+// /* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
+//  */
+
+// #include "simpleeventcatcher.h"
+
+// SimpleEventCatcher::SimpleEventCatcher(FileSystemWatcher* watcher, QObject *parent) :
+//   QObject(parent)
+// {
+//   // register for directory event signal (callback function)
+//   QObject::connect(watcher, SIGNAL(dirEventSignal(std::vector<sEventInfo>)), this, SLOT(handleDirEvent(std::vector<sEventInfo>)));
+// }
+
+// void SimpleEventCatcher::handleDirEvent(std::vector<sEventInfo> dirChanges)
+// {
+//   qDebug() << endl << "[SIGNAL] From SimpleEventCatcher Slot:";
+
+//   if(!dirChanges.empty())
+//     {
+//       for(size_t i = 0; i < dirChanges.size(); i++)
+//         {
+//           QString tempString;
+
+//           eEvent event = dirChanges[i].event;
+//           QString absFilePath = QString::fromStdString(dirChanges[i].absFilePath);
+
+//           switch(event)
+//             {
+//             case ADDED:
+//               tempString.append("ADDED: ");
+//               break;
+//             case MODIFIED:
+//               tempString.append("MODIFIED: ");
+//               break;
+//             case DELETED:
+//               tempString.append("DELETED: ");
+//               break;
+//             }
+
+//           tempString.append (absFilePath);
+
+//           qDebug() << "\t" << tempString;
+//         }
+//     }
+//   else
+//     {
+//       qDebug() << "\t[EMPTY]";
+//     }
+// }
+
+// #if WAF
+// #include "simpleeventcatcher.moc"
+// #include "simpleeventcatcher.cpp.moc"
+// #endif
diff --git a/fs-watcher/simpleeventcatcher.h b/fs-watcher/simpleeventcatcher.h
new file mode 100644
index 0000000..a99d1f8
--- /dev/null
+++ b/fs-watcher/simpleeventcatcher.h
@@ -0,0 +1,41 @@
+// /* -*- 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: Jared Lindblom <lindblom@cs.ucla.edu>
+//  */
+
+// #ifndef SIMPLEEVENTCATCHER_H
+// #define SIMPLEEVENTCATCHER_H
+
+// #include "filesystemwatcher.h"
+// #include <QObject>
+// #include <QDebug>
+// #include <vector>
+// #include <structs.h>
+
+// class SimpleEventCatcher : public QObject
+// {
+//   Q_OBJECT
+// public:
+//   explicit SimpleEventCatcher(FileSystemWatcher* watcher, QObject *parent = 0);
+
+// public slots:
+//   // handle signal
+//   void handleDirEvent(std::vector<sEventInfo> dirChanges);
+// };
+
+// #endif // SIMPLEEVENTCATCHER_H
diff --git a/filesystemwatcher/structs.h b/fs-watcher/structs.h
similarity index 100%
rename from filesystemwatcher/structs.h
rename to fs-watcher/structs.h
diff --git a/gui/chronosharegui.cpp b/gui/chronosharegui.cpp
index 8f46363..13c3a51 100644
--- a/gui/chronosharegui.cpp
+++ b/gui/chronosharegui.cpp
@@ -21,10 +21,13 @@
 #include "chronosharegui.h"
 #include "logging.h"
 
+
+
 INIT_LOGGER ("Gui");
 
 ChronoShareGui::ChronoShareGui(QWidget *parent)
   : QWidget(parent)
+  , m_watcher (0)
   // , m_settingsFilePath(QDir::homePath() + "/.chronoshare")
 {
   // load settings
@@ -46,10 +49,21 @@
 
   // show tray icon
   m_trayIcon->show();
+
+  // Dispatcher(const boost::filesystem::path &path, const std::string &localUserName,  const Ccnx::Name &localPrefix,
+  //            const std::string &sharedFolder, const boost::filesystem::path &rootDir,
+  //            Ccnx::CcnxWrapperPtr ccnx, SchedulerPtr scheduler, int poolSize = 2);
+
+  m_watcher = new FsWatcher (m_dirPath);
 }
 
 ChronoShareGui::~ChronoShareGui()
 {
+  if (!m_watcher)
+    {
+      delete m_watcher;
+    }
+
   // cleanup
   delete m_trayIcon;
   delete m_trayIconMenu;
@@ -158,9 +172,8 @@
 {
   // prompt user for new directory
   QString tempPath = QFileDialog::getExistingDirectory(this, tr("Choose a new folder"),
-                                                       m_dirPath, QFileDialog::ShowDirsOnly |
-                                                       QFileDialog::DontResolveSymlinks);
-  QFileInfo qFileInfo(tempPath);
+                                                       m_dirPath, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
+  QFileInfo qFileInfo (tempPath);
 
   if(qFileInfo.isDir())
     m_dirPath = tempPath;
diff --git a/gui/chronosharegui.h b/gui/chronosharegui.h
index f0cbe76..b0d459e 100644
--- a/gui/chronosharegui.h
+++ b/gui/chronosharegui.h
@@ -33,6 +33,8 @@
 #include <QMessageBox>
 #include <QApplication>
 
+#include "fs-watcher.h"
+
 class ChronoShareGui : public QWidget
 {
   Q_OBJECT
@@ -93,6 +95,7 @@
 
   QString m_dirPath; // shared directory
 
+  FsWatcher *m_watcher;
   // QString m_settingsFilePath; // settings file path
   // QString m_settings;
 };
diff --git a/wscript b/wscript
index df1e2d3..b7d5d1a 100644
--- a/wscript
+++ b/wscript
@@ -62,6 +62,7 @@
         conf.env.append_value('CXXFLAGS', ['-O3', '-g', '-Qunused-arguments'])
 
     if conf.options._test:
+        conf.define ('_TESTS', 1)
         conf.env.TEST = 1
 
     conf.write_config_header('src/config.h')
@@ -102,11 +103,11 @@
           )
 
     qt = bld (
-        target = "filewatcher",
-        features = "qt4 cxx cxxprogram",
+        target = "fs-watcher",
+        features = "qt4 cxx",
         defines = "WAF",
-          source = bld.path.ant_glob(['filesystemwatcher/*.cpp']),
-        includes = "filesystemwatcher . ",
+          source = bld.path.ant_glob(['fs-watcher/*.cc']),
+        includes = "fs-watcher . src ",
         use = "QTCORE QTGUI LOG4CXX"
         )
 
@@ -136,6 +137,6 @@
 	features = "qt4 cxx cxxprogram",
 	defines = "WAF",
 	source = bld.path.ant_glob(['gui/*.cpp', 'gui/*.qrc']),
-	includes = "src gui . ",
-	use = "QTCORE QTGUI LOG4CXX ccnx database chronoshare"
+	includes = "src gui fs-watcher src . ",
+	use = "QTCORE QTGUI LOG4CXX fs-watcher ccnx database chronoshare"
 	)
