diff --git a/js/lwNDN.js b/js/lwNDN.js
new file mode 100644
index 0000000..cb9e8fc
--- /dev/null
+++ b/js/lwNDN.js
@@ -0,0 +1,114 @@
+
+
+var lwNDN = function lwNDN(host,port){
+	this.host = host;
+	this.port = port;
+};
+
+lwNDN.prototype.createRoute = function(host,port){
+	this.host=host;
+	this.port=port;
+}
+
+lwNDN.prototype.get = function(message){
+	if(this.host!=null && this.port!=null){
+		var output ='';
+		message = message.trim();
+		if(message==null || message =="" ){
+			console.log('INVALID INPUT TO GET');
+			return null;
+		}
+		
+		
+		//var array = ContentName.createNameArray(message);
+
+		int = new Interest(new ContentName(message));
+
+		int.InterestLifetime = 4200;
+		
+		var hex = encodeToHexInterest(int);
+		
+		//var result = get_java_socket_bridge().connectAndStart(ndnurl,ndnport,hex);
+		
+		var result = get(this.host,this.port, hex);
+
+
+		if(LOG>0)console.log('BINARY RESPONSE IS ' +result);
+		
+		if(result==null || result==undefined || result =="" ){
+			/*if(result[0] != '0'||result[1]!='4') {
+				if(LOG>2)console.log('INVALID ANSWER');
+			}*/
+			return null;
+		}
+		
+		else{
+			
+			co = decodeHexContentObject(result);
+
+			if(LOG>2) {
+				console.log('DECODED CONTENT OBJECT');
+				console.log(co);
+			}
+			return co;
+		}
+	}
+	else{
+
+		console.log('ERROR URL OR PORT NOT SET');
+
+		return null;
+
+	}
+	
+
+}
+
+
+lwNDN.prototype.put = function(name,content){
+	if(this.host!=null && this.port!=null){
+		
+
+		name = name.trim();
+		
+		var fe = new ForwardingEntry('selfreg',new ContentName(name),null, null, 3,2147483647);
+		
+		var bytes = encodeForwardingEntry(fe);
+		
+		
+		var si = new SignedInfo();
+		si.setFields();
+		
+		var co = new ContentObject(new ContentName(),si,bytes,new Signature()); 
+		co.sign();
+		
+		var coBinary = encodeToBinaryContentObject(co);
+		
+		var ccnxnodename = unescape('%E0%A0%1E%099h%F9t%0C%E7%F46%1B%AB%F5%BB%05%A4%E5Z%AC%A5%E5%8Fs%ED%DE%B8%E0%13%AA%8F');
+		
+		var interestName = new ContentName(['ccnx',ccnxnodename,'prefixreg',coBinary]);
+
+		int = new Interest(interestName);
+		int.Scope = 1;
+		
+		var hex = encodeToHexInterest(int);
+
+		console.log('GOING TO PUT INTEREST OBJECT');
+		
+		console.log(hex);
+		
+		var result = put(this.host,this.port, hex,name);
+
+		return result;
+
+	}
+	else{
+
+		console.log('ERROR URL OR PORT NOT SET');
+
+		return null;
+
+	}
+	
+
+}
\ No newline at end of file
