diff --git a/public/translateTable.js b/public/translateTable.js
index ec8b00a..e45266b 100644
--- a/public/translateTable.js
+++ b/public/translateTable.js
@@ -1,6 +1,6 @@
 // Store Table object in global object
 
-var splitRegex = /^([^\/]+?)(?:\/(.+?))?:([^:]+?)$/;
+var splitRegex = /^([^\/]+?)(?:\/([^:]+?))?:(.+?)$/;
 
 var textFoundry = "Foundry";
 var textLayer = "Layer";
@@ -17,6 +17,12 @@
     for (var i in children) {
       var c = children[i];
 
+      // Create object on position unless it exists
+      if (this.info[this.pos] === undefined)
+	this.info[this.pos] = {};
+
+      var found = this.info[this.pos];
+
       // element with title
       if (c.nodeType === 1) {
 	if (c.getAttribute("title")) {
@@ -33,11 +39,10 @@
 	      layer = RegExp.$1
 	    };
 
-	    // Create object on position unless it exists
-	    if (!this.info[this.pos])
-	      this.info[this.pos] = {};
+	    if (found[foundry + "/" + layer] === undefined)
+	      found[foundry + "/" + layer] = [];
 
-	    this.info[this.pos][foundry + "/" + layer] = RegExp.$3;
+	    found[foundry + "/" + layer].push(RegExp.$3);
 
 	    // Set foundry
 	    if (!this.foundry[foundry])
@@ -57,10 +62,12 @@
       }
 
       // Leaf node - store string on position and go to next string
-      else if (c.nodeType === 3)
-	if (c.nodeValue.match(/[-a-z0-9]/i))
+      else if (c.nodeType === 3) {
+	if (c.nodeValue.match(/[a-z0-9]/i))
 	  this.info[this.pos++]["-s"] = c.nodeValue;
+      };
     };
+    delete this.info[this.pos];
     return this;
   };
 
@@ -157,8 +164,15 @@
 	  var td = d.createElement('td');
 	  tr.appendChild(td);
 
-	  if (this.info[t][infoString] !== undefined)
-	    td.appendChild(d.createTextNode(this.info[t][infoString]));
+	  var surfaces = this.info[t][infoString];
+	  if (surfaces !== undefined) {
+	    for (i in surfaces) {
+	      td.appendChild(d.createTextNode(surfaces[i]));
+	      if (i !== surfaces.length -1) {
+		td.appendChild(d.createElement("br"));
+	      };
+	    };
+	  };
 	};
 	rowSpan++;
       };
@@ -177,3 +191,30 @@
 };
 
 
+function showTable (o) {
+  var match = o.parentNode.parentNode;
+  var table = $(match).children("div").children("div.tokenInfo").first();
+
+  if (table.hasClass("active")) {
+    table.removeClass("active");
+    return;
+  }
+  else if (table.children("table").length > 0) {
+    table.addClass("active");
+    return;
+  };
+
+  var corpusID = match.getAttribute('data-corpus-id');
+  var docID    = match.getAttribute('data-doc-id');
+  var matchID  = match.getAttribute('data-match-id');
+  var url      = '/corpus/' + corpusID + '/' + docID + '/' + matchID;
+  var snippet;
+
+  jQuery.getJSON(url, function (res) {
+    var snippet = new SnippetTable(res['snippet']);
+    table.addClass("active");
+    table.append(snippet.toTable());
+  });
+};
+
+
