diff --git a/gui/chronosharegui.cpp b/gui/chronosharegui.cpp
index 0bf70d8..0285f78 100644
--- a/gui/chronosharegui.cpp
+++ b/gui/chronosharegui.cpp
@@ -21,60 +21,140 @@
 #include "chronosharegui.h"
 #include "ui_chronosharegui.h"
 
-ChronoShareGui::ChronoShareGui(QString dirPath, QWidget *parent) :
+ChronoShareGui::ChronoShareGui(QWidget *parent) :
     QWidget(parent),
-    m_dirPath(dirPath)
+    m_fileDialogWidget(new QWidget())
 {
+    // load settings
+    loadSettings();
+
+    // create actions that result from clicking a menu option
     createActions();
+
+    // create tray icon
     createTrayIcon();
+
+    // set icon image
     setIcon();
 
+    // show tray icon
     m_trayIcon->show();
 }
 
 ChronoShareGui::~ChronoShareGui()
 {
+    // cleanup
     delete m_trayIcon;
     delete m_trayIconMenu;
     delete m_openFolder;
+    delete m_changeFolder;
     delete m_quitProgram;
+    delete m_fileDialogWidget;
 }
 
 void ChronoShareGui::createActions()
 {
-    m_openFolder = new QAction(tr("&Open"), this);
+    // create the "open folder" action
+    m_openFolder = new QAction(tr("&Open Folder"), this);
     connect(m_openFolder, SIGNAL(triggered()), this, SLOT(openSharedFolder()));
 
+    // create the "change folder" action
+    m_changeFolder = new QAction(tr("&Change Folder"), this);
+    connect(m_changeFolder, SIGNAL(triggered()), this, SLOT(openFileDialog()));
+
+    // create the "quit program" action
     m_quitProgram = new QAction(tr("&Quit"), this);
     connect(m_quitProgram, SIGNAL(triggered()), qApp, SLOT(quit()));
+
 }
 
 void ChronoShareGui::createTrayIcon()
 {
+    // create a new icon menu
     m_trayIconMenu = new QMenu(this);
 
+    // add actions to the menu
     m_trayIconMenu->addAction(m_openFolder);
+    m_trayIconMenu->addAction(m_changeFolder);
     m_trayIconMenu->addSeparator();
     m_trayIconMenu->addAction(m_quitProgram);
 
+    // create new tray icon
     m_trayIcon = new QSystemTrayIcon(this);
+
+    // associate the menu with the tray icon
     m_trayIcon->setContextMenu(m_trayIconMenu);
+
+    // handle left click of icon
+    connect(m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconClicked(QSystemTrayIcon::ActivationReason)));
 }
 
 void ChronoShareGui::setIcon()
 {
+    // set the icon image
     m_trayIcon->setIcon(QIcon(":/images/friends-group-icon.png"));
 }
 
 void ChronoShareGui::openSharedFolder()
 {
+    // tell Finder to open the shared folder
     QStringList scriptArgs;
     scriptArgs << QLatin1String("-e")
                << QString::fromLatin1("tell application \"Finder\" to reveal POSIX file \"%1\"")
                                      .arg(m_dirPath);
+
+    // execute the commands to make it happen
     QProcess::execute(QLatin1String("/usr/bin/osascript"), scriptArgs);
+
+    // clear command arguments
     scriptArgs.clear();
+
+    // tell Finder to appear
     scriptArgs << QLatin1String("-e")
                << QLatin1String("tell application \"Finder\" to activate");
+
+    // execute the commands to make it happen
     QProcess::execute("/usr/bin/osascript", scriptArgs);
 }
+
+void ChronoShareGui::openFileDialog()
+{
+    // prompt user for new directory
+    m_dirPath = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
+                                                    m_dirPath, QFileDialog::ShowDirsOnly |
+                                                     QFileDialog::DontResolveSymlinks);
+
+    qDebug() << m_dirPath;
+
+    // save settings
+    saveSettings();
+}
+
+void ChronoShareGui::trayIconClicked(QSystemTrayIcon::ActivationReason reason)
+{
+    // if double clicked, open shared folder
+    if(reason == QSystemTrayIcon::DoubleClick)
+    {
+        openSharedFolder();
+    }
+}
+
+void ChronoShareGui::loadSettings()
+{
+    // Load Settings
+    QSettings settings(m_settingsFilePath, QSettings::NativeFormat);
+    m_dirPath = settings.value("dirPath", QDir::homePath()).toString();
+}
+
+void ChronoShareGui::saveSettings()
+{
+    // Save Settings
+    QSettings settings(m_settingsFilePath, QSettings::NativeFormat);
+    settings.setValue("dirPath", m_dirPath);
+}
+
+void ChronoShareGui::closeEvent(QCloseEvent* event)
+{
+    qDebug() << "Close Event.";
+    event->ignore(); // don't let the event propagate to the base class
+}
