diff --git a/js/image-loader.html b/js/image-loader.html
index 1cc66c3..ddcf751 100644
--- a/js/image-loader.html
+++ b/js/image-loader.html
@@ -74,201 +74,42 @@
 	<script language="JavaScript" type="text/javascript" src="securityLib/x509-1.1.js"></script>
 
 	<script type="text/javascript">
-		function run(){
+	var loadedImageString = "";
+	var connector = new lwNDN('127.0.0.1', 9695);
+	var pieceNumber = 0;
+	var count = 0;
+	var end = false;
+	var LOG = 0;
 
-
-			var contentName = document.getElementById('contentname').value;
-		
-			///////////////////////////////////////
-			//createRoute('131.179.141.15', 9695);
-		    //createRoute('borges.metwi.ucla.edu', 9695);
-		    ///  /ndn/ucla.edu/apps/hydra/mainvideo
-		    ///////////////////////////////////////
-		
-			var connector = new lwNDN('127.0.0.1', 9695);
-		    //var connector = new lwNDN('borges.metwi.ucla.edu', 9695);
-		    
-			var co = connector.get( contentName );
-			
-			///////////////////////////////////////
-			//PRINT OUTPUT
-			///////////////////////////////////////
-			
-			var output ="";
-			
-			if(co==null)
-				output+= "NO CONTENT FOUND"
-			else{
-				if(co.Name!=null && co.Name.Components!=null){
-					output+= "NAME: ";
-					
-					for(var i=0;i<co.Name.Components.length;i++){
-						output+= "/"+ DataUtils.toString(co.Name.Components[i]);
-					}
-					output+= "<br />";
-					output+= "<br />";
-				}
 	
-				if(co.Content !=null){
-					output += "CONTENT(ASCII): "+ DataUtils.toString(co.Content);
-					
-					output+= "<br />";
-					output+= "<br />";
-				}
-				if(co.Content !=null){
-					output += "CONTENT(hex): "+ DataUtils.toHex(co.Content);
-					
-					output+= "<br />";
-					output+= "<br />";
-				}
-				
-				if(co.Signature !=null && co.Signature.Signature!=null){
-					
-					output += "SIGNATURE(hex): "+ DataUtils.toHex(co.Signature.Signature);
-					
-					output+= "<br />";
-					output+= "<br />";
-				}
-				if(co.SignedInfo !=null && co.SignedInfo.Publisher!=null && co.SignedInfo.Publisher.PublisherPublicKeyDigest!=null){
-					
-					output += "Publisher Public Key Digest(hex): "+ DataUtils.toHex(co.SignedInfo.Publisher.PublisherPublicKeyDigest);
-					
-					output+= "<br />";
-					output+= "<br />";
-				}
-				if(co.SignedInfo !=null && co.SignedInfo.Timestamp!=null){
-					
-					output += "TimeStamp: "+ co.SignedInfo.Timestamp.getJavascriptDate();
-					
-					output+= "<br />";
-					output+= "<br />";
-					
-					output += "TimeStamp (MILLISECONDS): "+ co.SignedInfo.Timestamp.msec;
-					
-					output+= "<br />";
-					output+= "<br />";
-				}
-				if(co.SignedInfo!=null && co.SignedInfo.Locator!=null && co.SignedInfo.Locator.PublicKey!=null){
-					
-					var publickey = rstr2b64(DataUtils.toString(co.SignedInfo.Locator.PublicKey));
-					var publickeyHex = DataUtils.toHex(co.SignedInfo.Locator.PublicKey).toLowerCase();
-					var publickeyString = DataUtils.toString(co.SignedInfo.Locator.PublicKey);
-					
-					var signature = DataUtils.toHex(co.Signature.Signature).toLowerCase();
-					
-					
-					var input = DataUtils.toString(co.rawSignatureData);
-					 
-					
-					output += "DER Certificate: "+publickey ;
-					
-					output+= "<br />";
-					output+= "<br />";
-					
-					
+	function getPiece(){
+		if(!pieceNumber) pieceNumber = 0;
+		var contentName = "/image/piece" + pieceNumber;
+// 		var connector = new lwNDN('127.0.0.1', 9695);
+		var co = connector.get( contentName );
 
-					if(LOG>2) console.log(" ContentName + SignedInfo + Content = "+input);
-					if(LOG>2) console.log(" PublicKey = "+publickey );
-					if(LOG>2) console.log(" PublicKeyHex = "+publickeyHex );
-					if(LOG>2) console.log(" PublicKeyString = "+publickeyString );
-					
-					if(LOG>2) console.log(" Signature "+signature );
-					
-					if(LOG>2) console.log(" Signature NOW IS" );
-					
-					if(LOG>2) console.log(co.Signature.Signature);
-					
-					
-					/*var x509 = new X509();
-					
-					x509.readCertPEM(publickey);
-					
-					
-					//x509.readCertPEMWithoutRSAInit(publickey);
-
-					var result = x509.subjectPublicKeyRSA.verifyString(input, signature);*/
-					//console.log('result is '+result);
-					
-					
-					var kp = publickeyHex.slice(56,314);
-					
-					output += "PUBLISHER KEY(hex): "+kp ;
-					
-					output+= "<br />";
-					output+= "<br />";
-					
-					console.log('PUBLIC KEY IN HEX is ');
-					console.log(kp);
-
-					var exp = publickeyHex.slice(318,324);
-					
-					console.log('kp size is '+kp.length );
-					output += "exponent: "+exp ;
-					
-					output+= "<br />";
-					output+= "<br />";
-					
-					console.log('EXPONENT is ');
-					console.log(exp);
-
-					
-					
-					/*var c1 = hex_sha256(input);
-					var c2 = signature;
-					
-					if(LOG>4)console.log('input is ');
-					if(LOG>4)console.log(input);
-					if(LOG>4)console.log('C1 is ');
-					if(LOG>4)console.log(c1);
-					if(LOG>4)console.log('C2 is ');
-					if(LOG>4)console.log(c2);
-					var result = c1 == c2;*/
-					
-					var rsakey = new RSAKey();
-					
-					rsakey.setPublic(kp,exp);
-					
-					var result = rsakey.verifyByteArray(co.rawSignatureData,signature);
-				   // var result = rsakey.verifyString(input, signature);
-					
-				    
-				    
-				    console.log('PUBLIC KEY n after is ');
-					console.log(rsakey.n);
-
-					console.log('EXPONENT e after is ');
-					console.log(rsakey.e);
-					
-					
-					if(result)
-						output += 'SIGNATURE VALID';
-					else
-						output += 'SIGNATURE INVALID';
-
-						
-					
-					
-					//output += "VALID: "+ toHex(co.SignedInfo.Locator.PublicKey);
-					
-					output+= "<br />";
-					output+= "<br />";
-					
-					document.getElementById('image').src += DataUtils.toString(co.Content);
-					//if(LOG>4) console.log('str'[1]);
-				}
+		if(co){
+			 loadedImageString += DataUtils.toString(co.Content);
+			count++;
+			if(co.Content.length == 500){
+				pieceNumber += co.Content.length;
+				getPiece();
 			}
-			
-			document.getElementById('result').innerHTML = output;
+			else document.getElementById('image').src += loadedImageString;
 		}
+	}
+	
+
+			
+			
 	
 		</script>
 	
 </head>
 <body >
-	<form>
-		Please Enter a Content Name:<br /><input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> <br />
-	</form>
-	<button onclick="run()">Request Data!</button>
+	<div>
+	<button onclick="getPiece()">Get image</button>
+	</div>
 	<div >
 		<applet id="JavaSocketBridge" archive="JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
 		</applet>
