diff --git a/gui/html/chronoshare-helpers.js b/gui/html/chronoshare-helpers.js
index 3e33f4f..6e13caf 100644
--- a/gui/html/chronoshare-helpers.js
+++ b/gui/html/chronoshare-helpers.js
@@ -86,3 +86,73 @@
     url += "&item=" + encodeURIComponent (encodeURIComponent (fileName));
     document.location = url;
 };
+
+
+displayContent = function (newcontent, more, baseUrl) {
+
+    // if (!PARAMS.offset || PARAMS.offset==0)
+    // {
+    $("#content").fadeOut ("fast", function () {
+        $(this).replaceWith (newcontent);
+        $("#content").fadeIn ("fast");
+    });
+
+    $("#content-nav").fadeOut ("fast", function () {
+        $("#content-nav a").hide ();
+
+        if (PARAMS.offset !== undefined || more !== undefined) {
+            $("#content-nav").fadeIn ("fast");
+
+            if (more !== undefined) {
+                $("#get-more").show ();
+
+                $("#get-more").unbind ('click').click (function () {
+                    url = baseUrl;
+                    url += "&offset="+more;
+
+                    document.location = url;
+                });
+            }
+            if (PARAMS.offset > 0) {
+                $("#get-less").show ();
+
+                $("#get-less").unbind ('click').click (function () {
+                    url = baseUrl;
+                    if (PARAMS.offset > 1) {
+                        url += "&offset="+(PARAMS.offset - 1);
+                    }
+
+                    document.location = url;
+                });
+            }
+        }
+    });
+    // }
+    // else {
+    //     tbody.children ().each (function (index, row) {
+    //         $("#history-list-actions").append (row);
+    //     });
+    // }
+};
+
+
+function custom_alert (output_msg, title_msg)
+{
+    if (!title_msg)
+        title_msg = 'Alert';
+
+    if (!output_msg)
+        output_msg = 'No Message to Display';
+
+    $("<div></div>").html(output_msg).dialog({
+        title: title_msg,
+        resizable: false,
+        modal: true,
+        buttons: {
+            "Ok": function()
+            {
+                $( this ).dialog( "close" );
+            }
+        }
+    });
+}
\ No newline at end of file
diff --git a/gui/html/chronoshare-navigation.js b/gui/html/chronoshare-navigation.js
index 7dafd71..8856ec0 100644
--- a/gui/html/chronoshare-navigation.js
+++ b/gui/html/chronoshare-navigation.js
@@ -20,24 +20,33 @@
             vars[hash[0]] = decodeURIComponent (decodeURIComponent (hash[1]));
         }
 
-        if (page != PAGE)
-        {
-            PAGE = page;
-            PARAMS = vars;
-            URIPARAMS = aurl[1];
+        // if (page != PAGE)
+        // {
+        //     PAGE = page;
+        //     PARAMS = vars;
+        //     URIPARAMS = aurl[1];
 
-            if (CHRONOSHARE) {
-                CHRONOSHARE.run ();
-            }
-        }
-        else if (aurl[1] != URIPARAMS)
-        {
-            PARAMS = vars;
-            URIPARAMS = aurl[1];
+        //     if (CHRONOSHARE) {
+        //         CHRONOSHARE.run ();
+        //     }
+        // }
+        // else if (aurl[1] != URIPARAMS)
+        // {
+        //     PARAMS = vars;
+        //     URIPARAMS = aurl[1];
 
-            if (CHRONOSHARE) {
-                CHRONOSHARE.run ();
-            }
+        //     if (CHRONOSHARE) {
+        //         CHRONOSHARE.run ();
+        //     }
+        // }
+
+        // this way we can reload by just clicking on the same link
+        PAGE = page;
+        PARAMS = vars;
+        URIPARAMS = aurl[1];
+
+        if (CHRONOSHARE) {
+            CHRONOSHARE.run ();
         }
     }
 }
@@ -66,5 +75,9 @@
     $(window).on('hashchange', function() {
         nav_anchor (window.location.href);
     });
+
+    $("#reload-button").click (function() {
+        nav_anchor (window.location.href);
+    });
 });
 
diff --git a/gui/html/chronoshare.js b/gui/html/chronoshare.js
index b4c3d73..91fe02e 100644
--- a/gui/html/chronoshare.js
+++ b/gui/html/chronoshare.js
@@ -65,15 +65,35 @@
          return { request: request, callback: new HistoryClosure (this) };
      },
 
-     cmd_restore_file: function (filename, version, hash) {
+     cmd_restore_file: function (filename, version, hash, callback/*function (bool <- data received, status <- returned status)*/) {
          request = new Name ().add (this.restore)
              .add (filename)
              .addSegment (version)
              .add (hash);
          console.log (request.to_uri ());
+	 this.ndn.expressInterest (request, new CmdRestoreFileClosure (this, callback));
      }
  });
 
+$.Class ("CmdRestoreFileClosure", {}, {
+    init: function (chronoshare, callback) {
+        this.chronoshare = chronoshare;
+	this.callback = callback;
+    },
+    upcall: function(kind, upcallInfo) {
+        if (kind == Closure.UPCALL_CONTENT) {
+            convertedData = DataUtils.toString (upcallInfo.contentObject.content);
+	    this.callback (true, convertedData);
+	}
+        else if (kind == Closure.UPCALL_INTEREST_TIMED_OUT) {
+	    this.callback (false, "Interest timed out");
+        }
+        else {
+	    this.callback (false, "Unknown error happened");
+        }
+    }
+});
+
 $.Class ("FilesClosure", {}, {
     init: function (chronoshare) {
         this.chronoshare = chronoshare;
@@ -91,6 +111,9 @@
 
             tbody = $("<tbody />", { "id": "file-list-files" });
 
+            /// @todo Eventually set title for other pages
+            $("title").text ("ChronoShare - List of files" + (PARAMS.item?" - "+PARAMS.item:""));
+
             // error handling?
             newcontent = $("<div />", { "id": "content" }).append (
 		$("<h2 />").append ($(document.createTextNode("List of files ")), $("<green />").text (PARAMS.item)),
@@ -126,7 +149,7 @@
 			    .prepend ($("<img />", { "src": fileExtension(file.filename) })));
 		row.append ($("<td />", { "class": "version" }).text (file.version));
 		row.append ($("<td />", { "class": "size" }).text (SegNumToFileSize (file.segNum)));
-		row.append ($("<td />", { "class": "modified" }).text (new Date (file.timestamp)));
+		row.append ($("<td />", { "class": "modified" }).text (new Date (file.timestamp+"+00:00"))); // convert from UTC
 		row.append ($("<td />", { "class": "modified-by border-right"})
 			    .append ($("<userName />").text (file.owner.userName))
 			    .append ($("<seqNo> /").text (file.owner.seqNo)));
@@ -134,60 +157,11 @@
 		tbody = tbody.append (row);
             }
 
-            // if (!PARAMS.offset || PARAMS.offset==0)
-            // {
-            $("#content").fadeOut ("fast", function () {
-                $(this).replaceWith (newcontent);
-                $("#content").fadeIn ("fast");
-            });
+	    displayContent (newcontent, data.more, this.base_url ());
 
-            self = this; // small "cheat"
-            $("#content-nav").fadeOut ("fast", function () {
-                $("#content-nav a").hide ();
-
-                if (PARAMS.offset !== undefined || data.more !== undefined) {
-                    $("#content-nav").fadeIn ("fast");
-
-                    if (data.more !== undefined) {
-                        $("#get-more").show ();
-
-                        $("#get-more").unbind ('click').click (function () {
-                            url = self.base_url ();
-                            url += "&offset="+data.more;
-
-                            document.location = url;
-                        });
-                    }
-                    if (PARAMS.offset > 0) {
-                        $("#get-less").show ();
-
-                        $("#get-less").unbind ('click').click (function () {
-                            url = self.base_url ();
-                            if (PARAMS.offset > 1) {
-                                url += "&offset="+(PARAMS.offset - 1);
-                            }
-
-                            document.location = url;
-                        });
-                    }
-                }
-            });
-            // }
-            // else {
-            //     tbody.children ().each (function (index, row) {
-            //         $("#history-list-actions").append (row);
-            //     });
-            // }
-
+	    $.contextMenu( 'destroy',  ".with-context-menu" ); // cleanup
 	    $.contextMenu({
 		selector: ".with-context-menu",
-		events: {
-		    show: function (opt) {
-			console.log(opt.$trigger.attr ("filename"));
-			opt.items.info.name = opt.$trigger.attr ("filename");
-			console.log (opt.items.info.name);
-		    },
-		},
 		items: {
 		    "info": {name: "x", type: "html", html: "<b>File operations</b>"},
 		    "sep1": "---------",
@@ -196,9 +170,7 @@
 			      callback: function(key, opt) {
 				  openHistoryForItem (opt.$trigger.attr ("filename"));
 			      }},
-		    // bar: {name: "Bar", callback: function(key, opt){ alert("Bar!") }}
 		}
-		// there's more, have a look at the demos and docs...
 	    });
         }
         else if (kind == Closure.UPCALL_INTEREST_TIMED_OUT) {
@@ -240,6 +212,9 @@
 
             tbody = $("<tbody />", { "id": "history-list-actions" });
 
+            /// @todo Eventually set title for other pages
+            $("title").text ("ChronoShare - Recent actions" + (PARAMS.item?" - "+PARAMS.item:""));
+
             newcontent = $("<div />", { "id": "content" }).append (
 		$("<h2 />").append ($(document.createTextNode("Recent actions ")), $("<green />").text (PARAMS.item)),
                 $("<table />", { "class": "item-list" })
@@ -247,44 +222,42 @@
                              .append ($("<tr />")
                                       .append ($("<th />", { "class": "filename border-left", "scope": "col" }).text ("Filename"))
                                       .append ($("<th />", { "class": "version", "scope": "col" }).text ("Version"))
+                                      .append ($("<th />", { "class": "size", "scope": "col" }).text ("Size"))
                                       .append ($("<th />", { "class": "modified", "scope": "col" }).text ("Modified"))
                                       .append ($("<th />", { "class": "modified-by border-right", "scope": "col" }).text ("Modified By"))))
                     .append (tbody)
                     .append ($("<tfoot />")
                              .append ($("<tr />")
-                                      .append ($("<td />", { "colspan": "4", "class": "border-right border-left" })))));
+                                      .append ($("<td />", { "colspan": "5", "class": "border-right border-left" })))));
 
             for (var i = 0; i < data.actions.length; i++) {
                 action = data.actions[i];
 
-	        row = $("<tr />");
+		row = $("<tr />");
 	        if (i%2) { row.addClass ("odd"); }
-                if (action.action=="DELETE") { row.addClass ("delete"); }
+                if (action.action=="DELETE") {
+		    row.addClass ("delete");
+		}
+		else {
+		    row.addClass ("with-context-menu");
+                    row.attr ("file_version", action.version);
+		    row.attr ("file_hash", action.update.hash);
+		    row.attr ("file_modified_by", action.id.userName);
+		}
+
+                row.attr ("filename", action.filename);
+                row.bind('click', function (e) { openHistoryForItem ($(this).attr ("filename")) });
 
                 row.bind('mouseenter mouseleave', function() {
                     $(this).toggleClass('highlighted');
                 });
 
-                row.attr ("filename", action.filename);
-                row.attr ("file_version", action.version);
-		row.attr ("file_hash", action.hash);
-
-                // row.bind('click', function (e) {
-                //     url = "#fileHistory";
-                //     url += "&item=" + $(this).attr ("filename");
-                //     pos = URIPARAMS.indexOf ("&");
-                //     if (pos >= 0) {
-                //         url += URIPARAMS.substring (pos)
-                //     }
-
-                //     document.location = url;
-                // });
-
 		row.append ($("<td />", { "class": "filename border-left" })
 			    .text (action.filename)
 			    .prepend ($("<img />", { "src": fileExtension(action.filename) })));
 	        row.append ($("<td />", { "class": "version" }).text (action.version));
-	        row.append ($("<td />", { "class": "timestamp" }).text (new Date (action.timestamp)));
+		row.append ($("<td />", { "class": "size" }).text (action.update?SegNumToFileSize (action.update.segNum):""));
+	        row.append ($("<td />", { "class": "timestamp" }).text (new Date (action.timestamp+"+00:00"))); // conversion from UTC timezone (we store action time in UTC)
 	        row.append ($("<td />", { "class": "modified-by border-right" })
 	        	    .append ($("<userName />").text (action.id.userName))
 	        	    .append ($("<seqNo> /").text (action.id.seqNo)));
@@ -292,50 +265,58 @@
 	        tbody = tbody.append (row);
             }
 
-            // if (!PARAMS.offset || PARAMS.offset==0)
-            // {
-            $("#content").fadeOut ("fast", function () {
-                $(this).replaceWith (newcontent);
-                $("#content").fadeIn ("fast");
-            });
+	    displayContent (newcontent, data.more, this.base_url (PAGE));
 
-            self = this; // small "cheat"
-            $("#content-nav").fadeOut ("fast", function () {
-                $("#content-nav a").hide ();
+	    $.contextMenu( 'destroy',  ".with-context-menu" ); // cleanup
+	    $.contextMenu({
+		selector: ".with-context-menu",
+		items: {
+		    "sep1": "---------",
+		    restore: {name: "Restore this revision",
+			      icon: "cut", // need a better icon
+			      callback: function(key, opt) {
+				  filename = opt.$trigger.attr ("filename");
+				  version = opt.$trigger.attr ("file_version");
+				  hash = DataUtils.toNumbers (opt.$trigger.attr ("file_hash"));
+				  console.log (hash);
+				  modified_by = opt.$trigger.attr ("file_modified_by");
 
-                if (PARAMS.offset !== undefined || data.more !== undefined) {
-                    $("#content-nav").fadeIn ("fast");
+				  $("<div />", { "title": "Restore version " + version + "?" })
+				      .append ($("<p />")
+					       .append ($("<span />", { "class": "ui-icon ui-icon-alert",
+								        "style": "float: left; margin: 0 7px 50px 0;" }),
+							$(document.createTextNode ("Are you sure you want restore version ")),
+							$("<green/>").text (version),
+							$(document.createTextNode (" by ")),
+							$("<green/>").text (modified_by)))
+				      .dialog ({
+					  resizable: true,
+					  height:200,
+					  width:300,
+					  modal: true,
+					  buttons: {
+					      "Restore": function() {
+						  self = $(this);
+						  CHRONOSHARE.cmd_restore_file (filename, version, hash, function(didGetData, response) {
+						      if (!didGetData || response != "OK") {
+							  custom_alert (response);
+						      }
+						      console.log (response);
+						      self.dialog ("close");
 
-                    if (data.more !== undefined) {
-                        $("#get-more").show ();
-
-                        $("#get-more").unbind ('click').click (function () {
-                            url = self.base_url (PAGE);
-                            url += "&offset="+data.more;
-
-                            document.location = url;
-                        });
-                    }
-                    if (PARAMS.offset > 0) {
-                        $("#get-less").show ();
-
-                        $("#get-less").unbind ('click').click (function () {
-                            url = self.base_url (PAGE);
-                            if (PARAMS.offset > 1) {
-                                url += "&offset="+(PARAMS.offset - 1);
-                            }
-
-                            document.location = url;
-                        });
-                    }
-                }
-            });
-            // }
-            // else {
-            //     tbody.children ().each (function (index, row) {
-            //         $("#history-list-actions").append (row);
-            //     });
-            // }
+						      $.timer (function() {CHRONOSHARE.run ();}).once (1000);
+						  });
+					      },
+					      Cancel: function() {
+						  $(this).dialog ("close");
+					      }
+					  }
+				      });
+				  // openHistoryForItem (opt.$trigger.attr ("filename"));
+			      }},
+		    "sep2": "---------",
+		}
+	    });
         }
         else if (kind == Closure.UPCALL_INTEREST_TIMED_OUT) {
             $("#error").html ("Interest timed out");
diff --git a/gui/html/css/style.css b/gui/html/css/style.css
index 62e640f..a4211ca 100644
--- a/gui/html/css/style.css
+++ b/gui/html/css/style.css
@@ -203,6 +203,7 @@
 
 .delete .filename {
     color: red;
+    text-decoration: line-through;
 }
 
 .version {
diff --git a/gui/html/css/text.css b/gui/html/css/text.css
index 2a2fd22..b115a70 100755
--- a/gui/html/css/text.css
+++ b/gui/html/css/text.css
@@ -61,17 +61,17 @@
 /* `Spacing
 ----------------------------------------------------------------------------------------------------*/
 
-ol {
-  list-style: decimal;
-}
+/* ol { */
+/*   list-style: decimal; */
+/* } */
 
-ul {
-  list-style: disc;
-}
+/* ul { */
+/*   list-style: disc; */
+/* } */
 
-li {
-  margin-left: 30px;
-}
+/* li { */
+/*   margin-left: 30px; */
+/* } */
 
 p,
 dl,
diff --git a/gui/html/favicon.ico b/gui/html/favicon.ico
new file mode 100644
index 0000000..b2991e1
--- /dev/null
+++ b/gui/html/favicon.ico
Binary files differ
diff --git a/gui/html/index.html b/gui/html/index.html
index f006cce..ab2409c 100644
--- a/gui/html/index.html
+++ b/gui/html/index.html
@@ -17,8 +17,11 @@
     <script type="text/javascript" src="js/jquery-ui.min.js"></script>
     <script type="text/javascript" src="js/jquery.class.min.js"></script>
     <script type="text/javascript" src="js/jquery.contextMenu.js"></script>
+    <script type="text/javascript" src="js/jquery.timer.js"></script>
 
     <script type="text/javascript" src="js/ndn-js.js"></script>
+
+    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
   </head>
 
   <body>
@@ -30,6 +33,7 @@
         <ul>
           <li><a class="needs-get-url" href="#fileList">All files</a></li>
           <li><a class="needs-get-url" href="#folderHistory">Recent actions</a></li>
+          <li><a class="ajax-action" id="reload-button">Reload current view</a></li>
         </ul>
       </nav>
     </header>
diff --git a/gui/html/js/jquery.timer.js b/gui/html/js/jquery.timer.js
new file mode 100755
index 0000000..0e2e5be
--- /dev/null
+++ b/gui/html/js/jquery.timer.js
@@ -0,0 +1,111 @@
+/**
+ * jquery.timer.js
+ *
+ * Copyright (c) 2011 Jason Chavannes <jason.chavannes@gmail.com>
+ *
+ * http://jchavannes.com/jquery-timer
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+;(function($) {
+	$.timer = function(func, time, autostart) {	
+	 	this.set = function(func, time, autostart) {
+	 		this.init = true;
+	 	 	if(typeof func == 'object') {
+		 	 	var paramList = ['autostart', 'time'];
+	 	 	 	for(var arg in paramList) {if(func[paramList[arg]] != undefined) {eval(paramList[arg] + " = func[paramList[arg]]");}};
+ 	 			func = func.action;
+	 	 	}
+	 	 	if(typeof func == 'function') {this.action = func;}
+		 	if(!isNaN(time)) {this.intervalTime = time;}
+		 	if(autostart && !this.isActive) {
+			 	this.isActive = true;
+			 	this.setTimer();
+		 	}
+		 	return this;
+	 	};
+	 	this.once = function(time) {
+			var timer = this;
+	 	 	if(isNaN(time)) {time = 0;}
+			window.setTimeout(function() {timer.action();}, time);
+	 		return this;
+	 	};
+		this.play = function(reset) {
+			if(!this.isActive) {
+				if(reset) {this.setTimer();}
+				else {this.setTimer(this.remaining);}
+				this.isActive = true;
+			}
+			return this;
+		};
+		this.pause = function() {
+			if(this.isActive) {
+				this.isActive = false;
+				this.remaining -= new Date() - this.last;
+				this.clearTimer();
+			}
+			return this;
+		};
+		this.stop = function() {
+			this.isActive = false;
+			this.remaining = this.intervalTime;
+			this.clearTimer();
+			return this;
+		};
+		this.toggle = function(reset) {
+			if(this.isActive) {this.pause();}
+			else if(reset) {this.play(true);}
+			else {this.play();}
+			return this;
+		};
+		this.reset = function() {
+			this.isActive = false;
+			this.play(true);
+			return this;
+		};
+		this.clearTimer = function() {
+			window.clearTimeout(this.timeoutObject);
+		};
+	 	this.setTimer = function(time) {
+			var timer = this;
+	 	 	if(typeof this.action != 'function') {return;}
+	 	 	if(isNaN(time)) {time = this.intervalTime;}
+		 	this.remaining = time;
+	 	 	this.last = new Date();
+			this.clearTimer();
+			this.timeoutObject = window.setTimeout(function() {timer.go();}, time);
+		};
+	 	this.go = function() {
+	 		if(this.isActive) {
+	 			this.action();
+	 			this.setTimer();
+	 		}
+	 	};
+	 	
+	 	if(this.init) {
+	 		return new $.timer(func, time, autostart);
+	 	} else {
+			this.set(func, time, autostart);
+	 		return this;
+	 	}
+	};
+})(jQuery);
\ No newline at end of file
