diff --git a/.DS_Store b/.DS_Store
index e384a76..d2205a4 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/js/FaceInstance.js b/js/FaceInstance.js
new file mode 100644
index 0000000..6a709fe
--- /dev/null
+++ b/js/FaceInstance.js
@@ -0,0 +1,152 @@
+
+
+
+var FaceInstance  = function FaceInstance(
+	    _Action,
+		_PublisherPublicKeyDigest,
+		_FaceID,
+		_IPProto,
+		_Host,
+		_Port,
+		_MulticastInterface,
+		_MulticastTTL,
+		_FreshnessSeconds,){
+		
+	
+	this.Action = _Action,
+	this.PublisherPublicKeyDigest = _PublisherPublicKeyDigest,
+	this.FaceID = _FaceID,
+	this.IPProto = _IPProto,
+	this.Host = _Host,
+	this.Port = _Port,
+	this.MulticastInterface =_MulticastInterface,
+	this.MulticastTTL =_MulticastTTL,
+	this.FreshnessSeconds = _FreshnessSeconds,
+	
+	
+	//Action           ::= ("newface" | "destroyface" | "queryface")
+	//PublisherPublicKeyDigest ::= SHA-256 digest
+	//FaceID           ::= nonNegativeInteger
+	//IPProto          ::= nonNegativeInteger [IANA protocol number, 6=TCP, 17=UDP]
+	//Host             ::= textual representation of numeric IPv4 or IPv6 address
+	//Port             ::= nonNegativeInteger [1..65535]
+	//MulticastInterface ::= textual representation of numeric IPv4 or IPv6 address
+	//MulticastTTL     ::= nonNegativeInteger [1..255]
+	//FreshnessSeconds ::= nonNegativeInteger
+
+};
+
+/**
+ * Used by NetworkObject to decode the object from a network stream.
+ * @see org.ccnx.ccn.impl.encoding.XMLEncodable
+ */
+FaceInstance.prototype.decode(//XMLDecoder 
+	decoder) {
+
+	decoder.readStartElement(this.getElementLabel());
+	
+	if (decoder.peekStartElement(CCNProtocolDTags.Action)) {
+		
+		this.Action = decoder.readUTF8Element(CCNProtocolDTags.Action);
+		
+	}
+	if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
+		
+		this.PublisherPublicKeyDigest = new PublisherPublicKeyDigest();
+		this.PublisherPublicKeyDigest.decode(decoder);
+		
+	}
+	if (decoder.peekStartElement(CCNProtocolDTags.FaceID)) {
+		
+		this.FaceID = decoder.readIntegerElement(CCNProtocolDTags.FaceID);
+		
+	}
+	if (decoder.peekStartElement(CCNProtocolDTags.IPProto)) {
+		
+		//int
+		var pI = decoder.readIntegerElement(CCNProtocolDTags.IPProto);
+		
+		this.IPProto = null;
+		
+		if (NetworkProtocol.TCP.value().intValue() == pI) {
+			
+			this.IPProto = NetworkProtocol.TCP;
+			
+		} else if (NetworkProtocol.UDP.value().intValue() == pI) {
+			
+			this.IPProto = NetworkProtocol.UDP;
+			
+		} else {
+			
+			throw new Exception("FaceInstance.decoder.  Invalid " + 
+					CCNProtocolDTags.tagToString(CCNProtocolDTags.IPProto) + " field: " + pI);
+			
+		}
+	}
+	
+	if (decoder.peekStartElement(CCNProtocolDTags.Host)) {
+		
+		this.Host = decoder.readUTF8Element(CCNProtocolDTags.Host);
+		
+	}
+	
+	if (decoder.peekStartElement(CCNProtocolDTags.Port)) {
+		this.Port = decoder.readIntegerElement(CCNProtocolDTags.Port); 
+	}
+	
+	if (decoder.peekStartElement(CCNProtocolDTags.MulticastInterface)) {
+		this.MulticastInterface = decoder.readUTF8Element(CCNProtocolDTags.MulticastInterface); 
+	}
+	
+	if (decoder.peekStartElement(CCNProtocolDTags.MulticastTTL)) {
+		this.MulticastTTL = decoder.readIntegerElement(CCNProtocolDTags.MulticastTTL); 
+	}
+	
+	if (decoder.peekStartElement(CCNProtocolDTags.FreshnessSeconds)) {
+		this.FreshnessSeconds = decoder.readIntegerElement(CCNProtocolDTags.FreshnessSeconds); 
+	}
+	
+	decoder.readEndElement();
+}
+
+/**
+ * Used by NetworkObject to encode the object to a network stream.
+ * @see org.ccnx.ccn.impl.encoding.XMLEncodable
+ */
+public void encode(XMLEncoder encoder) throws ContentEncodingException {
+	if (!validate()) {
+		throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing.");
+	}
+	encoder.writeStartElement(getElementLabel());
+	if (null != _action && _action.length() != 0)
+		encoder.writeElement(CCNProtocolDTags.Action, _action);	
+	if (null != _ccndID) {
+		_ccndID.encode(encoder);
+	}
+	if (null != _faceID) {
+		encoder.writeElement(CCNProtocolDTags.FaceID, _faceID);
+	}
+	if (null != _ipProto) {
+		encoder.writeElement(CCNProtocolDTags.IPProto, _ipProto.value());
+	}
+	if (null != _host && _host.length() != 0) {
+		encoder.writeElement(CCNProtocolDTags.Host, _host);	
+	}
+	if (null != _port) {
+		encoder.writeElement(CCNProtocolDTags.Port, _port);
+	}
+	if (null != _multicastInterface && _multicastInterface.length() != 0) {
+		encoder.writeElement(CCNProtocolDTags.MulticastInterface, _multicastInterface);
+	}
+	if (null != _multicastTTL) {
+		encoder.writeElement(CCNProtocolDTags.MulticastTTL, _multicastTTL);
+	}
+	if (null != _lifetime) {
+		encoder.writeElement(CCNProtocolDTags.FreshnessSeconds, _lifetime);
+	}
+	encoder.writeEndElement();   			
+}
+
+
+FaceInstance.prototype.getElementLabel= function(){return CCNProtocolDTags.FaceInstance;};
+
diff --git a/js/index.html b/js/publish-data.html
similarity index 81%
copy from js/index.html
copy to js/publish-data.html
index 04e402e..84fb9ac 100644
--- a/js/index.html
+++ b/js/publish-data.html
@@ -51,18 +51,24 @@
 
 			var ContentName = document.getElementById('contentname').value;
 		
+			var Content = document.getElementById('content').value;
+			
+			
+			
 			///////////////////////////////////////
 		    //createRoute('localhost', 9695);
 
-		    createRoute('131.179.141.15', 9695);
+		    //createRoute('131.179.141.15', 9695);
 		    //createRoute('borges.metwi.ucla.edu', 9695);
 		    
 			//content object
-			var co = queryPrefix( ContentName );
+			//var co = queryPrefix( ContentName );
+			
+			
 			
 			///////////////////////////////////////
 			
-			var output ="";
+			/*var output ="";
 			
 			if(co==-1)
 				output+= "NO CONTENT FOUND"
@@ -106,9 +112,11 @@
 					output+= "<br />";
 	
 				}
-			}
+			}*/
 			
-			document.getElementById('result').innerHTML = output;
+			//document.getElementById('result').innerHTML = output;
+			document.getElementById('result').innerHTML = 'Content \'' + Content + '\' was published with content name \'' + ContentName +'\'';
+
 		}
 	
 		</script>
@@ -116,9 +124,19 @@
 </head>
 <body >
 	<form>
-		Please Enter a Content Name:<br /><input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> <br />
+
+		Please Enter a Content Name:<br />
+		
+		<input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> 
+		
+		Please Enter the Content:<br />
+		
+		<textarea id="content" cols="40" rows="5" name="CONTENT" value="SUCCESS"  >SUCCESS!</textarea> 
+		
+		
+		<br />
 	</form>
-	<button onclick="run()">Run!</button>
+	<button onclick="run()">Publish</button>
 	<div >
 		<applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
 		</applet>
diff --git a/js/index.html b/js/request-data.html
similarity index 98%
rename from js/index.html
rename to js/request-data.html
index 04e402e..f00510a 100644
--- a/js/index.html
+++ b/js/request-data.html
@@ -118,7 +118,7 @@
 	<form>
 		Please Enter a Content Name:<br /><input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> <br />
 	</form>
-	<button onclick="run()">Run!</button>
+	<button onclick="run()">Request Data!</button>
 	<div >
 		<applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
 		</applet>
