diff --git a/Prototype/FTPLibrary.js b/Prototype/FTPLibrary.js
index e4c5738..bd09962 100644
--- a/Prototype/FTPLibrary.js
+++ b/Prototype/FTPLibrary.js
@@ -409,11 +409,11 @@
   *     the data received.
   */
   function onReceiveCallback_(info) {
-    print("onReceiveCallback_", FTPInfo.commandId, info.socketId);
+    //console.log("onReceiveCallback_", FTPInfo.commandId, info.socketId);
     var decoder = new TextDecoder("utf-8");
     if (info.socketId == FTPInfo.commandId) {
       var receivedData = new Uint8Array(info.data);
-      print("COMMAND CONNETION:", decoder.decode(receivedData));
+      console.log("COMMAND CONNETION:", decoder.decode(receivedData));
       var responses = getReply_(receivedData);
       if (responses != null) {
         // got response(s)
@@ -425,7 +425,7 @@
       var receivedData = new Uint8Array(info.data);
       for (var socketId in FTPInfo.dataConnects) {
         if (info.socketId == socketId) {
-          print("DATA CONNECTION:", decoder.decode(receivedData));
+          console.log("DATA CONNECTION:", decoder.decode(receivedData));
           FTPInfo.dataConnects[socketId].onReceiveData(receivedData);
           break;
         }
@@ -442,10 +442,14 @@
       for (var socketId in FTPInfo.dataConnects) {
         socketId = parseInt(socketId);
         if (info.socketId == socketId) {
-          print("Found closing socket");
           var connectionInfo = FTPInfo.dataConnects[socketId];
-          connectionInfo.onComplete(FTPInfo.lsOutput + FTPInfo.lsDecoder.decode());
-          FTPInfo.lsOutput = "";
+          if (connectionInfo.command == "LIST") {
+            connectionInfo.onComplete(FTPInfo.lsOutput + FTPInfo.lsDecoder.decode());
+            FTPInfo.lsOutput = "";
+          }
+          else {
+            connectionInfo.onComplete();
+          }
           delete FTPInfo.dataConnects[socketId];
           socketType.close(socketId);
           print("Called close socket");
@@ -474,6 +478,105 @@
     return null;
   }
 
+  function getCurrentDir() {
+    console.log("getCurrentDir called")
+    return sendCommand_("PWD\r\n").then (function (reply) {
+      console.log("getCurrentDir reply", reply)
+      if (getReplyClass(reply) != ftpReply.OK) {
+        throw new UnexpectedReplyError();
+      }
+      else {
+        var dirStart = reply.search(" ") + 1; // the char following the first 
+                                             // space after the 3 digit code
+        if (reply[dirStart] == "\"") { // dirStart points at the quotation mark
+          var dirEnd = reply.indexOf("\"", dirStart+1); // find end of quotation
+          var dir = reply.slice(dirStart+1, dirEnd);
+          if (dir[dir.length-1] != "\/"){
+            dir += "\/";
+          }
+          console.log("parsed dir", dir);
+          return dir;
+        }
+      }
+    }).catch(function (error) {
+      throw error;
+    });
+  }
+
+  function changeWorkingDir(pathname) {
+    return sendCommand_("CWD " + pathname +"\r\n").then(function (reply) {
+      if (getReplyClass(reply) != ftpReply.OK) {
+        throw new UnexpectedReplyError();
+      }
+      else {
+        return reply;
+      }
+    }).catch(function (error){
+      throw error;
+    });
+  }
+
+  function changeToParentDir() {
+    return sendCommand_("CDUP\r\n").then(function (reply) {
+      if (getReplyClass(reply) != ftpReply.OK) {
+        throw new UnexpectedReplyError();
+      }
+      else {
+        return reply;
+      }
+    }).catch(function (error) {
+      throw error;
+    });
+  }
+
+  function download(remoteEntry, localEntry) {
+    var onDownloadComplete, dataId, dataPort;
+    var fileDownloaded = new Promise(function (resolve, reject) {
+      var downloadedCallback = function () {
+        resolve();
+      };
+      onDownloadComplete = downloadedCallback;
+    });
+    var onReceiveData = function (data) {
+      //save the data into the current file;
+    };
+    var confirmDownload = dataConnect_().then(function (info) {
+      dataId = info.socketId;
+      dataPort = info.port;
+      var connectionInfo = {
+        "command": "RETR",
+        "onComplete": onListDirComplete,
+        "onReceiveData": onReceiveData
+      };
+      FTPInfo.dataConnects[dataId] = connectionInfo;
+      return sendCommand_("RETR + remoteEntry\r\n");
+    }).then(function (reply) {
+      var replyClass = getReplyClass(reply);
+      if (replyClass == ftpReply.PRELIMINARY) {
+        return readFinalReply_();
+      }
+      else if (replyClass == ftpReply.OK) {
+        return reply;
+      }
+      else {
+        // unexpected 3xx response
+        throw new UnexpectedReplyError();
+      }
+    }).then(function (reply) {
+      var replyClass = getReplyClass(reply);
+      if (replyClass == ftpReply.OK) {
+        return reply;
+      }
+      else {
+        // unexpected 3xx response 
+        throw new UnexpectedReplyError();
+      }
+    }).catch(function (error) {
+      throw error;
+    });
+    return Promise.all([confirmDownload, fileDownloaded]);
+  }
+
   /**
   * listDir - returns the promise of a directory listing once one is received.
   * The function returns a directory listing once the data connection has been
@@ -512,6 +615,7 @@
       dataId = info.socketId;
       dataPort = info.port;
       var connectionInfo = {
+        "command": "LIST",
         "onComplete": onListDirComplete,
         "onReceiveData": onReceiveData
       };
@@ -573,18 +677,20 @@
   * function to mimick a synchronous behaviour using javascript native promises.
   */
   function connectWrapper_(socketId, host, port) {
+    print("connect wraper socketId, host, port:", socketId, host, port);
     var socketType = FTPInfo.socketType;
     return new Promise(function (resolve, reject) {
       var onConnectionComplete = function (result) {
         print("ConnectWrapper_ result = " + result);
         if (result < 0) {
-          reject(new ConnectError("Connect error code " + result));
+          reject(new ConnectError("Error code " + result));
         }
         else {
           resolve(result);
         }
       };
       socketType.connect(socketId, host, port, onConnectionComplete);
+      print("called socket.tcp.connect")
     });
   }
 
@@ -740,6 +846,7 @@
     print("Entering send");
     var promise = new Promise(function (resolve, reject) {
       var onCompleteSend = function (sendResult) {
+        print("Send Result = " + sendResult);
         print("Send Result = " + sendResult.resultCode);
         if (sendResult.resultCode < 0) {
           reject(new SendError("Send error code " + sendResult.resultCode));
@@ -822,9 +929,13 @@
     });
   }
 
-  this.connect = connect;
   this.login = login;
+  this.connect = connect;
+  this.getCurrentDir = getCurrentDir;
+  this.changeWorkingDir = changeWorkingDir;
   this.listDir = listDir;
+  this.changeToParentDir = changeToParentDir;
+  this.download = download;
   this.logOut = logOut;
   this.test = {
     FTPInfo: FTPInfo,
diff --git a/Prototype/FTPSession.js b/Prototype/FTPSession.js
index 2b1d994..43733fe 100644
--- a/Prototype/FTPSession.js
+++ b/Prototype/FTPSession.js
@@ -1,23 +1,60 @@
 "use strict"
 
-function FTPSession(host, port, username, password) {
+function FTPSession(host, port) {
   this.host = host;
   this.port = port;
+}
+
+FTPSession.prototype.login = function(username, password) {
   this.username = username;
   this.password = password;
   this.generalClient = new FTPClient();
   var self = this;
-  self.generalClient.connect(self.host, self.port).then(function (welcomeMsg) {
+  return self.generalClient.connect(self.host, self.port).then(function (welcomeMsg) {
     return self.generalClient.login(self.username, self.password);
   }).catch(function (error) {
-    console.log(error);
+    throw error;
   });
-}
+};
 
-FTPSession.prototype.listDir = function (pathname) {
+FTPSession.prototype.changeWorkingDir = function(pathname) {
+  console.log("change directory required");
+  return this.generalClient.changeWorkingDir(pathname).catch(function (error) {
+    throw error;
+  });
+};
+
+FTPSession.prototype.changeToParentDir = function() {
+  return this.generalClient.changeToParentDir().catch(function (error) {
+    throw error;
+  });
+};
+
+FTPSession.prototype.getCurrentDir = function() {
+  return this.generalClient.getCurrentDir().catch(function (error) {
+    throw error;
+  });
+};
+
+FTPSession.prototype.download = function(remoteEntry, localEntry) {
   var client = new FTPClient();
   var self = this;
-  client.connect(self.host, self.port).then(function (welcomeMsg) {
+  return client.connect(self.host, self.port).then(function (welcomeMsg) {
+    return client.login(self.username, self.password);
+  }).then(function (reply) {
+    return client.download(remoteEntry, localEntry);
+  }).then(function (reply) {
+    client.logOut();
+  }).catch(function (error) {
+    client.logOut();
+    throw error;
+  });
+};
+
+FTPSession.prototype.listDir = function(pathname) {
+  var client = new FTPClient();
+  var self = this;
+  return client.connect(self.host, self.port).then(function (welcomeMsg) {
     return client.login(self.username, self.password);
   }).then(function (reply) {
     return client.listDir(pathname);
@@ -26,9 +63,9 @@
     console.log("FTPSession listDir result:", directoryList[1]);
     return directoryList[1];
   }).catch(function (error) {
-    // Error handler to indicate the error to the user
     client.logOut();
     console.log(error);
+    throw error;
   });
 };
 
diff --git a/Prototype/FileSystem.js b/Prototype/FileSystem.js
new file mode 100644
index 0000000..2a1461d
--- /dev/null
+++ b/Prototype/FileSystem.js
@@ -0,0 +1,273 @@
+
+
+// namespace -> FTPUI
+// invoke the function,pass FTPUI into it, in the case that it doesn't exist, pass an object literal
+var FTPUI = (function (FTPUI) {
+  
+  FTPUI.remoteEntry = null;
+  FTPUI.localEntry = null;
+  
+  FTPUI.createRemoteDir = function (session, unixLsOutput) {
+    console.log("in create remote dir");
+    this.session = session;
+    try {
+      FTPUI.listRemote(unixLsOutput);
+    }
+    catch (error) {
+      FTPUI.notifyUI("Could not acces remote directory. " + error);
+    }
+  };
+
+  FTPUI.listRemote = function (unixLsOutput) {
+    try {
+      var entries = unixLsOutput.split(/[\r\n]+/g);
+      var remoteEntry = [];
+      if (entries[entries.length-1] == "") {
+        entries.pop();
+      }
+
+      var serverList = document.getElementById('remote-browser');
+      serverList.textContent = '';
+      //var $serverList = $('#remote-browser');
+      //$serverList.clear();
+      for (var i = 0; i < entries.length; i++) {
+
+        
+        //console.log(serverList);
+        var $li = $('<li>');
+        var $link = $('<a>');
+
+        var entry = entries[i];
+        var entryParts = entry.split(/\s+/);
+        var lastModDate = entryParts.slice(5,8).join(" ");
+        var filePerm = entryParts[0];
+        var links = entryParts[1];
+        var ownerID = entryParts[2];
+        var groupID = entryParts[3];
+        var size = entryParts[4];
+        var month = entryParts[5];
+        var day = entryParts[6];
+        var time = entryParts[7];
+        //console.log("entry:", entry, entry == "\r", entry == "");
+        var entryName = entry.match(/.{56}(.*)/)[1];
+
+        if (entry.search(/^d/) === 0) {
+          filePerm = filePerm.replace(/^d/,"");
+          //console.log(filePerm);
+          //console.log(entryName);
+          $link.prop('textContent', entryName += '/');
+          $link.addClass('listed-dir');
+          $link.appendTo($li);
+          $li.appendTo($(serverList));
+        }
+        else {
+          filePerm = filePerm.replace(/^./,"");
+          //console.log(filePerm);
+          //console.log(entryName);
+          $link.prop('textContent', entryName);
+          $link.addClass('listed-file');
+          $link.appendTo($li);
+          $li.appendTo($(serverList));
+        }
+        FTPUI.handleElement($link);
+      }
+    }
+    catch (error) {
+      throw error;
+    }
+  };
+
+  FTPUI.handleElement = function ($remoteEntry) {
+    var session = this.session;
+    var self = this;
+    $remoteEntry.dblclick(function () {
+      if ($remoteEntry.hasClass('listed-dir')) {
+        self.handleDirNavigation($remoteEntry);
+      }
+    });
+    $remoteEntry.click(function () {
+      if ($remoteEntry.hasClass('listed-file')) {
+        FTPUI.handleSelect($remoteEntry);
+        FTPUI.remoteEntry = $remoteEntry;
+      }
+    });
+  };
+
+  FTPUI.handleSelect = function(entry) {
+      entry.css({'backgroundColor': '#99CCFF'});
+      FTPUI.notifyUI('Selected Remote File: ' +  entry.text());
+      // change the text of the icon to be white, extend the selection
+  };
+
+  FTPUI.handleDirNavigation = function ($remoteEntry) {
+    var session = this.session;
+    console.log("We have clicked on a directory", $remoteEntry.text())
+    FTPUI.notifyUI('Entering Remote Directory: ' + $remoteEntry.text());
+    console.log($remoteEntry.text());
+    session.getCurrentDir().then(function (currentDir) {
+      session.changeWorkingDir($remoteEntry.text());
+      return currentDir;
+    }).then(function (currentDir) {
+      var dir = currentDir + $remoteEntry.text();
+      console.log("DIRRRRRRRRRRRRRRRRRRRR", dir);
+      return session.listDir(dir);
+    }).then(function (dirListing){
+      console.log("in handle element, got dir:", dirListing);
+      FTPUI.listRemote(dirListing);
+    }).catch(function (error) {
+      FTPUI.notifyUI("Could not get directory listing. " + error);
+    });
+  };
+
+  //FTP COMMAND: CDUP -> recieve unixOutput from LIST
+  // listremote(unixLsOutput)
+  FTPUI.handleRemoteBackButton = function () {
+    var session = this.session;
+    console.log("HANDLE REMOTE BACK BUTTON");
+    $('#remote-back').click(function() {
+      FTPUI.notifyUI('Going To Previous Remote Directory');
+      session.changeToParentDir().then(function () {
+        return session.getCurrentDir();
+      }).then(function (currentDir) {
+        return session.listDir(currentDir);
+      }).then(function (dirListing) {
+        FTPUI.listRemote(dirListing);
+      }).catch(function (error) {
+        FTPUI.notifyUI('Could not move to parent directory. ' + error);
+      });
+    });
+  };
+
+  FTPUI.handleLocalDir = function() {
+    var fileList = document.getElementById('local-browser');
+    $('#choose-directory').click(function() {
+      chrome.fileSystem.chooseEntry({type: 'openDirectory'}, function (entry) {
+        var rootEntry = entry;
+        var localDir = FTPUI.createLocalDir(entry, fileList);
+
+        // local back button functionality 
+        $('#local-back').click(function() {
+          try {
+              localDir.visitParent();
+              FTPUI.notifyUI('Going To Previous Local Directory');
+          } catch (error) {
+              console.log(err.message);
+          }
+        });
+
+        $('#save').click(function (){
+          try {
+              // make function more dynamic, also test with an arrayBuffer
+          saveToFile(rootEntry, 'justAString', function(){
+              localDir.listDirectory(rootEntry);
+          });
+          } catch (err){
+              console.log(err.message);
+          }
+        });
+      });
+    });
+  };
+
+  FTPUI.handleDownload = function() {
+    var session = this.session;
+   $('#download').click(function() {
+    if (!FTPUI.remoteEntry) { // or local entry is not a folder
+      // user has not selected a remote and local entry
+      return;
+    }
+    else {
+      if (!FTPUI.localEntry) {
+        //get local dir and download it there. 
+      }
+      else {
+        session.download(FTPUI.remoteEntry, FTPUI.localEntry);
+      }
+      FTPUI.remoteEntry = null;
+      FTPUI.localEntry = null;
+    }
+    });
+  };
+
+	FTPUI.createLocalDir = function(entry, element) {
+		var localDirectory = {
+			entry : entry,
+			latestEntry : entry,
+			listDirectory : function (entry) {
+				var entries = entry; //for readability
+				var DirectoryLister = entries.createReader(); //creates a Directory Reader object for listing contents of a directory
+				DirectoryLister.readEntries(fetchEntries);
+				var list = [];
+				function fetchEntries (entries) {
+					//once all entries have been returend by readEntries() it produces an empty array
+					//the entries produced by readEntries must not include the directory itself "." or its parent ".."
+					if (entries.length === 0) {
+						localDirectory.displayEntries(list, element);
+					}
+					else {
+						for ( var i = 0; i < entries.length; i++) {
+							list.push(entries[i]);
+						}
+						DirectoryLister.readEntries(fetchEntries); //keep calling readEntries() until we get an empty array
+					}
+				}
+				localDirectory.latestEntry = entry;
+			},
+			displayEntries : function (entries, element) {
+			// clear the current entries
+			element.textContent = '';
+			// Array.forEach paremeters (value of element,index of element, the arrayObject itself)
+			entries.forEach(function (entry, i, entries) {
+
+				var $li = $('<li>');
+				var $link = $('<a>');
+					if (entries[i].isDirectory) {
+							$link.prop('textContent', entry.name += '/');
+							$link.addClass('listed-dir');
+					} else {
+							$link.prop('textContent', entry.name);
+							$link.addClass('listed-file');
+					}
+
+					//add anchor tag to li element
+					$link.appendTo($li);
+
+					//add li element to un-ordered element list
+					$li.appendTo($(element));
+
+					$link.dblclick(function() {
+						if ($link.hasClass('listed-dir')) {
+							localDirectory.listDirectory(entry);
+							FTPUI.notifyUI('Entering Local Directory: ' + $link.text());
+						} else {
+							FTPUI.notifyUI('Selected Local File: ' +  $link.text());
+						}
+					});
+          $link.click(function () {
+            FTPUI.handleSelect($link);
+            FTPUI.localEntry = $link;
+          });
+				});
+			},
+			visitParent : function() {
+				this.latestEntry.getDirectory('..', {create: false}, localDirectory.listDirectory.bind(this));
+			},
+		};
+		//populate the fileBrowser
+		localDirectory.listDirectory(entry);
+		return localDirectory;
+
+	};
+
+  /* Send the User message updates */
+  /* @param Type: String or Error Object*/
+  FTPUI.notifyUI = function (notification) {
+    if(typeof notifcation === Error) notification.toString();
+    var $li = $('<li>');
+    $li.prop('textContent', notification);
+      $('#ui-message').append($li);
+  };
+  
+  return FTPUI;
+
+}(FTPUI || {}));
diff --git a/Prototype/QUnit.html b/Prototype/QUnit.html
index 0d51b1f..d2c8bcb 100644
--- a/Prototype/QUnit.html
+++ b/Prototype/QUnit.html
@@ -8,7 +8,7 @@
   <script src="third_party/TextEncoder/encoding-indexes.js"></script>
   <script src="third_party/TextEncoder/encoding.js"></script>
   <script src="SocketMock.js"></script>
-  <script src="FTPModule.js"></script>
+  <script src="FTPLibrary.js"></script>
   <script src="tests.js"></script>
 </head>
 <body>
diff --git a/Prototype/background.js b/Prototype/background.js
index 39629d2..817ad71 100644
--- a/Prototype/background.js
+++ b/Prototype/background.js
@@ -1,12 +1,26 @@
 chrome.app.runtime.onLaunched.addListener(function() {
-  chrome.app.window.create('connectWindow.html', {
+  chrome.app.window.create('twoPane.html', {
     'bounds': {
-      'width': 586,
-      'height': 346
+      'width': 1130,
+      'height': 665
     },
-    minWidth: 586,
-    minHeight: 346,
-    maxWidth: 586,
-    maxHeight: 346
+    minWidth: 1130,
+    minHeight: 665,
+    maxWidth: 1130,
+    maxHeight: 665
   });
-});
\ No newline at end of file
+});
+
+
+
+
+//       'bounds': {
+//       'width': 586,
+//       'height': 346
+//     },
+//     minWidth: 586,
+//     minHeight: 346,
+//     maxWidth: 586,
+//     maxHeight: 346
+//   });
+// });
\ No newline at end of file
diff --git a/Prototype/connectWindow.css b/Prototype/connectWindow.css
index 21f052c..3f0ad02 100644
--- a/Prototype/connectWindow.css
+++ b/Prototype/connectWindow.css
@@ -45,4 +45,28 @@
 	color: white;
 	font-weight: bold;
 	font-family: "Lucida Bright", Georgia, serif;
+}
+
+
+#result-console {
+	background-color: #F7F7F7;
+	width: 360px;
+	height: 31px;
+	position: relative;
+	left: 85px;
+	bottom: 64px;
+	border-radius: 3px;
+	box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
+	border: 1px solid #D9D9D9;
+	margin-bottom: 1em;
+}
+
+#message {
+	color: black;
+	font-size: 13px;
+	font-family: "Lucida Bright", Georgia, serif;
+	font-weight: bold;
+	position: fixed;
+	bottom: 23px;
+	left: 99px;
 }
\ No newline at end of file
diff --git a/Prototype/connectWindow.html b/Prototype/connectWindow.html
index 21df5ef..9ff5e04 100644
--- a/Prototype/connectWindow.html
+++ b/Prototype/connectWindow.html
@@ -25,10 +25,14 @@
 				<input type="submit" value="Connect" class= "connect">
 		    </div>
 		</form>
+	    <div id = "result-console"> 
+	    	<div id = "message">
+	    	</div>
+	    </div>
 		<script src="third_party/jquery.js"></script>
 		<script src="third_party/TextEncoder/encoding-indexes.js"></script>
 		<script src="third_party/TextEncoder/encoding.js"></script>
-		<script src="FTPModule.js"></script>
+		<script src="FTPLibrary.js"></script>
 		<script src="FTPSession.js"></script>
 		<script src="main.js"></script>
 	</body>
diff --git a/Prototype/dir-icon.png b/Prototype/dir-icon.png
new file mode 100644
index 0000000..77859eb
--- /dev/null
+++ b/Prototype/dir-icon.png
Binary files differ
diff --git a/Prototype/file-icon.png b/Prototype/file-icon.png
new file mode 100644
index 0000000..65e8d2e
--- /dev/null
+++ b/Prototype/file-icon.png
Binary files differ
diff --git a/Prototype/fileSystem.css b/Prototype/fileSystem.css
new file mode 100644
index 0000000..86953d0
--- /dev/null
+++ b/Prototype/fileSystem.css
@@ -0,0 +1,130 @@
+
+
+#local-files {
+  width: 526px;
+  float: left;
+}
+
+#local-files h2 {
+  text-align : center;
+}
+
+#local-files ul {
+  margin: 0;
+  padding: 0.5rem 1rem;
+  height: 410px;
+  overflow-y: auto;
+  list-style: none;
+  background: #F7F7F7;
+  border: 1px solid #D9D9D9;
+  border-radius: 3px;
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
+}
+
+#local-files li {
+  padding: 0.5rem 0;
+}
+
+
+
+#remote-files {
+  width: 526px;
+  float: right;
+}
+
+#remote-files h2 {
+  text-align: center;
+}
+
+#remote-files ul {
+  margin: 0;
+  padding: 0.5rem 1rem;
+  height: 410px;
+  overflow-y: auto;
+  list-style: none;
+  background: #F7F7F7;
+  border: 1px solid #D9D9D9;
+  border-radius: 3px;
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
+}
+
+#remote-files li {
+  padding: 0.5rem 0;
+}
+
+
+
+/*a.delete-file,
+a.delete-file:visited {
+  color: #CC0000;
+  margin-left: 0.5rem;
+}*/
+
+a:hover,
+a:focus {
+  color: #69c773;
+  cursor: pointer;
+}
+
+
+a.listed-dir {
+  background: url("dir-icon.png") left top no-repeat;
+  white-space: nowrap;
+  padding-left: 25px;
+}
+
+
+a.listed-file {
+  background: url("file-icon.png") left top no-repeat;
+  white-space: nowrap;
+  padding-left: 25px;
+}
+
+
+
+#ui-dialog {
+  width: 1109px;
+  height: 122px;
+  display: inline-block;
+  margin-bottom: 1rem;
+  position: relative;
+  top: 20px;
+  background: #F7F7F7;
+  border: 1px solid #D9D9D9;
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
+  overflow-x: auto;
+
+}
+
+#ui-message {
+  display: inline-block;
+  font-weight: bold;
+  color: #69c773;
+  margin-left: -23px;
+  list-style-type: none;
+}
+
+#download {
+  position: absolute;
+  right: 535px;
+  top: 208px;
+  width: 60px;
+  height: 30px;
+  font-size: 12px;
+  padding-left: 0px;
+}
+
+
+#upload {
+  position: absolute;
+  right: 535px;
+  top: 277px;
+  width: 60px;
+  height: 30px;
+  font-size: 12px;
+  padding-left: 0px;
+}
+
+
+
+
diff --git a/Prototype/index.js b/Prototype/index.js
new file mode 100644
index 0000000..bbe5c7c
--- /dev/null
+++ b/Prototype/index.js
@@ -0,0 +1,21 @@
+
+$(document).ready(function () {
+    console.log("We are in onload");
+    FTPUI.handleLocalDir();
+    var client = new FTPSession("ftp.mozilla.org", 21);
+    client.login("", "").then(function (welcomeMsg) {
+      client.listDir().then(function (listDir) {
+        console.log("got listDirectory");
+        FTPUI.createRemoteDir(client, listDir);
+        FTPUI.handleRemoteBackButton();
+      }).catch(function (error) {
+        // listDir error handling
+        console.log("LIST DIR ERRORRRRRRRRRRRRRR", error);
+      });
+    }).catch(function (error) {
+      console.log("Caught error login");
+    });
+
+});
+
+
diff --git a/Prototype/main.js b/Prototype/main.js
index c1e7a70..480d7da 100644
--- a/Prototype/main.js
+++ b/Prototype/main.js
@@ -1,10 +1,75 @@
-$(document).ready(function(){
-	$("#connect").click(function(){
-		var host = $("#host").val();
-		var username = $("#user").val();
-		var password = $("#password").val();
-		var port = $("#port").val();
-		var client = new FTPSession(host, port, username, password);
-		client.listDir();
+function handleLoginError(error) {
+  var result;
+  if (error.name == "PermanentError" || error.name == "TemporaryError") {
+    result = "Incorrect username or password";
+  }
+  else if (error.name == "ConnectError" || error.name == "CreateSocketError") {
+    // display "Could not connect to host, error code?"
+    result = "Could not connect to host: " + error.message;
+  }
+  else if (error.name == "FTPViolationError" || error.name == "UnexpectedReplyError") {
+    // display closing connection, server does not adhere to FTP protocol
+    result = "Server not adhering to FTP protocol. Closing connection.";
+  }
+  else {
+    // unexpected problem occured, please try again
+    console.log(error);
+    result = "Unexpected error occured. Please try again.";
+  }
+  document.getElementById("message").style.color = "red";
+  $('#message').text(result);
+}
+
+function displayNewWindow (client, listDir){
+  var onOpenWindowComplete = function (createdWindow) {
+    console.log("created new window");
+    createdWindow.contentWindow.directoryList = listDir;
+    createdWindow.contentWindow.session = client;
+    console.log("Was listRemote called?", clients);
+  };
+  chrome.app.window.create('twoPane.html', {
+  'bounds': {
+    'width': 1130,
+    'height': 665
+  },
+  minWidth: 1130,
+  minHeight: 665,
+  maxWidth: 1130,
+  maxHeight: 665
+  }, onOpenWindowComplete);
+}
+
+$(document).ready(function() {
+  $('#message').text("Please enter your credentials");
+	$("#connect").click(function() {
+    var host = $("#host").val();
+    var username = $("#user").val();
+    var password = $("#password").val();
+    var port = $("#port").val();
+    var client = new FTPSession(host, port);
+		client.login(username, password).then(function (welcomeMsg) {
+      document.getElementById("message").style.color = "green";
+      $('#message').text("Connected to host " + host);
+      client.listDir().then(function (listDir) {
+        console.log("got listDirectory, now calling display new window", clients)
+        displayNewWindow(client, listDir);
+      }).catch(function (error) {
+        // listDir error handling
+        console.log("LIST DIR ERRORRRRRRRRRRRRRR", error);
+      });
+		}).catch(function (error) {
+      console.log("Caught errrol");
+      handleLoginError(error);
+    });
 	});
 });
+
+
+
+
+
+
+
+
+
+
diff --git a/Prototype/twoPane.html b/Prototype/twoPane.html
new file mode 100644
index 0000000..3a89c34
--- /dev/null
+++ b/Prototype/twoPane.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <link rel="stylesheet" type="text/css" href="fileSystem.css">
+  </head>
+  <body>
+      <div id ="local-files">
+        <h2>Local Directory</h2>
+        <ul id="local-browser"></ul>
+        <button id ="choose-directory">Choose a Directory</button>
+        <button id ="local-back">Back</button>
+      </div>
+      <button id ="download">Download</button>
+      <button id ="upload">Upload</button>
+      <div id ="remote-files">
+        <h2>Remote Directory</h2>
+        <ul id="remote-browser"></ul>
+        <button id ="remote-back">Back</button>
+        <button id ="save">Save!</button>
+      </div>
+      <div id="ui-dialog">
+        <ul id="ui-message"></ul>
+      </div>
+    <!-- scripts -->
+      <script src="third_party/jquery.js"></script>
+      <script src="third_party/TextEncoder/encoding-indexes.js"></script>
+      <script src="third_party/TextEncoder/encoding.js"></script>
+      <script src="FTPLibrary.js"></script>
+      <script src="FTPSession.js"></script>
+      <script src="FileSystem.js" type="text/javascript"></script>
+      <script src="index.js" type="text/javascript"></script>
+  </body>
+</html>
+
+
