diff --git a/src/file-manifest.hpp b/src/file-manifest.hpp
index 8c4680a..8366db2 100644
--- a/src/file-manifest.hpp
+++ b/src/file-manifest.hpp
@@ -141,6 +141,14 @@
   data_packet_size() const;
   /// Returns the 'data_packet_size' of this FileManifest
 
+  size_t
+  submanifest_number() const;
+  /// Return the submanifest number for this FileManifest
+
+  std::string
+  file_name() const;
+  /// Return the file name for this FileManifest
+
   std::shared_ptr<Name>
   submanifest_ptr() const;
   /// Returns the 'submanifest_ptr' of this FileManifest, or 'nullptr' is none exists
@@ -301,6 +309,19 @@
   return m_submanifestPtr;
 }
 
+inline std::string
+FileManifest::file_name() const
+{
+  return name().getSubName(1, name().size() - 2).toUri();
+}
+
+
+inline size_t
+FileManifest::submanifest_number() const
+{
+  return name().get(name().size() - 1).toSequenceNumber();
+}
+
 inline void
 FileManifest::set_submanifest_ptr(std::shared_ptr<Name> subManifestPtr)
 {
diff --git a/src/torrent-file.hpp b/src/torrent-file.hpp
index 98e222c..0536c17 100644
--- a/src/torrent-file.hpp
+++ b/src/torrent-file.hpp
@@ -107,6 +107,18 @@
   getCatalog() const;
 
   /**
+   * @brief Get the segment number for this torrent file
+   */
+  size_t
+  getSegmentNumber() const;
+
+  /**
+   * @brief Get the directory name for this torrent file
+   */
+  std::string
+  getTorrentFilePath() const;
+
+  /**
    * @brief Decode from wire format
    */
   void
@@ -272,6 +284,19 @@
   return m_commonPrefix;
 }
 
+inline std::string
+TorrentFile::getTorrentFilePath() const
+{
+  return (0 == getSegmentNumber() ? getFullName().get(-3) : getFullName().get(-4)).toUri();
+}
+
+inline size_t
+TorrentFile::getSegmentNumber() const
+{
+  const auto& lastComponent = getName().get(getName().size() - 1);
+  return lastComponent.isSequenceNumber() ? lastComponent.toSequenceNumber() : 0;
+}
+
 
 } // namespace ntorrent
 
diff --git a/src/torrent-manager.cpp b/src/torrent-manager.cpp
index f62491f..afda819 100644
--- a/src/torrent-manager.cpp
+++ b/src/torrent-manager.cpp
@@ -28,13 +28,16 @@
 load_directory(const string& dirPath,
                ndn::io::IoEncoding encoding = ndn::io::IoEncoding::BASE_64) {
   vector<T> structures;
-
+  std::set<string> fileNames;
   if (fs::exists(dirPath)) {
-    for(fs::directory_iterator it(dirPath);
-      it !=  fs::directory_iterator();
+    for(fs::recursive_directory_iterator it(dirPath);
+      it !=  fs::recursive_directory_iterator();
       ++it)
     {
-      auto data_ptr = ndn::io::load<T>(it->path().string(), encoding);
+      fileNames.insert(it->path().string());
+    }
+    for (const auto& f : fileNames) {
+      auto data_ptr = ndn::io::load<T>(f, encoding);
       if (nullptr != data_ptr) {
         structures.push_back(*data_ptr);
       }
@@ -130,6 +133,7 @@
   security::KeyChain key_chain;
   Name currSegmentFullName = initialSegmentName;
   vector<TorrentFile> torrentSegments = load_directory<TorrentFile>(torrentFilePath);
+
   // Starting with the initial segment name, verify the names, loading next name from torrentSegment
   for (auto it = torrentSegments.begin(); it != torrentSegments.end(); ++it) {
     TorrentFile& segment = *it;
@@ -218,7 +222,7 @@
                      const TorrentFile& torrentFile)
 {
   vector<Data> packets;
-  auto subManifestNum = manifest.name().get(manifest.name().size() - 1).toSequenceNumber();
+  auto subManifestNum = manifest.submanifest_number();
 
   packets =  packetize_file(filePath,
                              manifest.name(),
@@ -243,8 +247,7 @@
                     const FileManifest& manifest)
 {
   // construct the file name
-  const auto manifestName = manifest.name();
-  auto fileName = manifestName.getSubName(1, manifestName.size() - 2).toUri();
+  auto fileName = manifest.file_name();
   auto filePath = dataPath + fileName;
   vector<bool> fileBitMap(manifest.catalog().size());
   auto fbits = fs::fstream::out | fs::fstream::binary;
@@ -283,7 +286,7 @@
       currCatalog = currTorrentFile_it->getCatalog();
     }
     // construct the file name
-    auto fileName = m.name().getSubName(1, m.name().size() - 2).toUri();
+    auto fileName = m.file_name();
     fs::path filePath = m_dataPath + fileName;
     // If there are any valid packets, add corresponding state to manager
     if (!fs::exists(filePath)) {
@@ -333,7 +336,7 @@
   if (nullptr == fileState.first) {
     fileState = initializeFileState(m_dataPath, *manifest_it);
   }
-  auto packetNum = packetName.get(packet.getName().size() - 1).toSequenceNumber();
+  auto packetNum = packetName.get(packetName.size() - 1).toSequenceNumber();
   // if we already have the packet, do not rewrite it.
   if (fileState.second[packetNum]) {
     return false;
@@ -355,6 +358,78 @@
   return true;
 }
 
+bool TorrentManager::writeTorrentSegment(const TorrentFile& segment, const std::string& path)
+{
+  // validate that this torrent segment belongs to our torrent
+  auto torrentPrefix = m_torrentFileName.getSubName(0, m_torrentFileName.size() - 1);
+  if (!torrentPrefix.isPrefixOf(segment.getName())) {
+    return false;
+  }
+
+  auto segmentNum = segment.getSegmentNumber();
+  // check if we already have it
+  if (m_torrentSegments.end() != std::find(m_torrentSegments.begin(), m_torrentSegments.end(),
+                                           segment))
+  {
+    return false;
+  }
+  // write to disk at path
+  if (!fs::exists(path)) {
+    fs::create_directories(path);
+  }
+  auto filename = path + to_string(segmentNum);
+  // if there is already a file on disk for this torrent segment, determine if we should override
+  if (fs::exists(filename)) {
+    auto segmentOnDisk_ptr = io::load<TorrentFile>(filename);
+    if (nullptr != segmentOnDisk_ptr && *segmentOnDisk_ptr == segment) {
+      return false;
+    }
+  }
+  io::save(segment, filename);
+  // add to collection
+  auto it = std::find_if(m_torrentSegments.begin(), m_torrentSegments.end(),
+                         [segmentNum](const TorrentFile& t){
+                           return t.getSegmentNumber() > segmentNum;
+                        });
+  m_torrentSegments.insert(it, segment);
+  return true;
+}
+
+bool TorrentManager::writeFileManifest(const FileManifest& manifest, const std::string& path)
+{
+  auto subManifestNum = manifest.submanifest_number();
+  fs::path filename = path + manifest.file_name() + "/" + to_string(subManifestNum);
+  // check if we already have it
+  if (m_fileManifests.end() != std::find(m_fileManifests.begin(), m_fileManifests.end(),
+                                         manifest))
+  {
+    return false;
+  }
+
+  // write to disk at path
+  if (!fs::exists(filename.parent_path())) {
+    boost::filesystem::create_directories(filename.parent_path());
+  }
+  // if there is already a file on disk for this torrent segment, determine if we should override
+  if (fs::exists(filename)) {
+    auto submanifestOnDisk_ptr = io::load<FileManifest>(filename.string());
+    if (nullptr != submanifestOnDisk_ptr && *submanifestOnDisk_ptr == manifest) {
+      return false;
+    }
+  }
+  io::save(manifest, filename.string());
+  // add to collection
+  // add to collection
+  auto it = std::find_if(m_fileManifests.begin(), m_fileManifests.end(),
+                         [&manifest](const FileManifest& m){
+                           return m.file_name() >  manifest.file_name()
+                           ||    (m.file_name() == manifest.file_name()
+                              && (m.submanifest_number() > manifest.submanifest_number()));
+                        });
+  m_fileManifests.insert(it, manifest);
+  return true;
+}
+
 void TorrentManager::seed(const Data& data) const {
   // TODO(msweatt) IMPLEMENT ME
 }
diff --git a/src/torrent-manager.hpp b/src/torrent-manager.hpp
index ca83a2b..fc790a8 100644
--- a/src/torrent-manager.hpp
+++ b/src/torrent-manager.hpp
@@ -28,7 +28,6 @@
 #include <ndn-cxx/data.hpp>
 
 #include <boost/filesystem/fstream.hpp>
-#include <boost/utility.hpp>
 
 #include <functional>
 #include <memory>
@@ -41,7 +40,7 @@
 namespace ndn {
 namespace ntorrent {
 
-class TorrentManager : boost::noncopyable {
+class TorrentManager : noncopyable {
   /**
    * \class TorrentManager
    *
@@ -93,9 +92,34 @@
 
  protected:
   bool writeData(const Data& packet);
-  // Write the Data packet to disk, return 'true' if data successfully written to disk 'false'
-  // otherwise. Behavior is undefined unless the corresponding file manifest has already been
-  // downloaded.
+  /*
+   * \brief Write @p packet composed of torrent date to disk.
+   * @param packet The data packet to be written to the disk
+   * Write the Data packet to disk, return 'true' if data successfully written to disk 'false'
+   * otherwise. Behavior is undefined unless the corresponding file manifest has already been
+   * downloaded.
+  */
+
+  bool writeTorrentSegment(const TorrentFile& segment, const std::string& path);
+  /*
+   * \brief Write the @p segment torrent segment to disk at the specified path.
+   * @param segment The torrent file segment to be written to disk
+   * @param path The path at which to write the torrent file segment
+   * Write the segment to disk, return 'true' if data successfully written to disk 'false'
+   * otherwise. Behavior is undefined unless @segment is a correct segment for the torrent file of
+   * this manager and @p path is the directory used for all segments of this torrent file.
+   */
+
+  bool writeFileManifest(const FileManifest& manifest, const std::string& path);
+  /*
+   * \brief Write the @p manifest file manifest to disk at the specified @p path.
+   * @param manifest The file manifest  to be written to disk
+   * @param path The path at which to write the file manifest
+   * Write the file manifest to disk, return 'true' if data successfully written to disk 'false'
+   * otherwise. Behavior is undefined unless @manifest is a correct file manifest for a file in the
+   * torrent file of this manager and @p path is the directory used for all file manifests of this
+   * torrent file.
+   */
 
   void onDataReceived(const Data& data);
 
