diff --git a/nlsr-sync-0.0/nlsr_sync.c b/nlsr-sync-0.0/nlsr_sync.c
index c63df07..289cf39 100644
--- a/nlsr-sync-0.0/nlsr_sync.c
+++ b/nlsr-sync-0.0/nlsr_sync.c
@@ -226,7 +226,7 @@
 }
 
 
-//char *
+
 void 
 get_content_by_content_name(char *content_name, unsigned char **content_data)
 {
@@ -312,9 +312,7 @@
 
 
 	if ( nlsr->debugging )
-		printf("process_incoming_sync_content_lsa called \n");
-	//if ( nlsr->detailed_logging )
-		//writeLogg(__FILE__,__FUNCTION__,__LINE__,"process_incoming_content_lsa called \n");	
+		printf("process_incoming_sync_content_lsa called \n");	
 
 	char *sep="|";
 	char *rem;
@@ -391,11 +389,31 @@
 
 			if ( nlsr->debugging )
 			{
+				printf("	Orig Time   : %s\n",orig_time);
 				printf("	No Link  : %d\n",no_link);
 				printf("	Data  : %s\n",data);
 			}
 			build_and_install_others_adj_lsa(orig_router,ls_type,orig_time,no_link,data);
 		}
+		else if ( ls_type == LS_TYPE_COR )
+		{
+			orig_time=strtok_r(NULL,sep,&rem);
+			char *cor_r=strtok_r(NULL,sep,&rem);
+			char *cor_theta=strtok_r(NULL,sep,&rem);
+
+			double r, theta;
+			r=strtof(cor_r,NULL);
+			theta=strtof(cor_theta,NULL);
+
+			if ( nlsr->debugging )
+			{
+				printf("	Orig Time   : %s\n",orig_time);
+				printf("	Cor R	    : %f\n",r);
+				printf("	Cor Theta   : %f\n",theta);
+			}
+			build_and_install_others_cor_lsa(orig_router,ls_type,orig_time, (double)r, (double)theta);	
+		}
+		
 	}
 }
 
@@ -423,9 +441,6 @@
 
 	struct name_prefix *orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix));
 	
-	//lsa_position=get_lsa_position(content_name, components);
-
-	//printf("LSA Position: %d \n",lsa_position);
 
 	struct ccn_indexbuf cid={0};
     	struct ccn_indexbuf *temp_components=&cid;
@@ -433,13 +448,11 @@
 	ccn_name_from_uri(name,nlsr->slice_prefix);
     	ccn_name_split (name, temp_components);
 	lsa_position=temp_components->n-2;
-	//printf("LSA Position from Slice Prefix Component: %d \n",(int)temp_components->n-2);
     	ccn_charbuf_destroy(&name);
 
 
 	res=ccn_name_comp_get(content_name->buf, components,lsa_position+1,&lst, &comp_size);
 	
-	//printf("Ls Type: %s\n",lst);
 	ls_type=atoi((char *)lst);
 	if(ls_type == LS_TYPE_NAME)
 	{
@@ -451,8 +464,6 @@
 
 		int lsa_life_time=get_time_diff(time_stamp,(char *)origtime);
 
-		//printf("Ls ID: %s\nOrig Time: %s\nOrig Router: %s\n",lsid,origtime,orig_router->name);
-
 		if ( (strcmp((char *)orig_router,nlsr->router_name) == 0 && lsa_life_time < nlsr->lsa_refresh_time) || (strcmp((char *)orig_router,nlsr->router_name) != 0 && lsa_life_time < nlsr->router_dead_interval) )
 		{
 			int is_new_name_lsa=check_is_new_name_lsa(orig_router->name,(char *)lst,(char *)lsid,(char *)origtime);
@@ -460,7 +471,6 @@
 			{
 				if ( nlsr->debugging )
 					printf("New NAME LSA.....\n");	
-				//content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
 				get_content_by_content_name(ccn_charbuf_as_string(uri), &content_data);
 				if ( nlsr->debugging )
 					printf("Content Data: %s \n",content_data);
@@ -470,7 +480,6 @@
 			{
 				if ( nlsr->debugging )
 					printf("Name LSA / Newer Name LSA already xists in LSDB\n");
-				//content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
 				get_content_by_content_name(ccn_charbuf_as_string(uri), &content_data);
 				
 				if ( nlsr->debugging )
@@ -492,9 +501,6 @@
 			printf("Orig Time: %s\nOrig Router: %s\n",origtime,orig_router->name);
 
 		int lsa_life_time=get_time_diff(time_stamp,(char *)origtime);
-
-		//printf("Ls ID: %s\nOrig Time: %s\nOrig Router: %s\n",lsid,origtime,orig_router->name);
-
 		if ( (strcmp((char *)orig_router,nlsr->router_name) == 0 && lsa_life_time < nlsr->lsa_refresh_time) || (strcmp((char *)orig_router,nlsr->router_name) != 0 && lsa_life_time < nlsr->router_dead_interval) )	
 		{
 			int is_new_adj_lsa=check_is_new_adj_lsa(orig_router->name,(char *)lst,(char *)origtime);
@@ -502,7 +508,6 @@
 			{
 				if ( nlsr->debugging )
 					printf("New Adj LSA.....\n");	
-				//content_data=get_content_by_content_name(ccn_charbuf_as_string(uri));
 				get_content_by_content_name(ccn_charbuf_as_string(uri), &content_data);
 				
 				if ( nlsr->debugging )
@@ -524,6 +529,44 @@
 				printf("Lsa is older than Router LSA refresh time/ Dead Interval\n");
 		}
 	}
+	else if(ls_type == LS_TYPE_COR)
+	{
+		res=ccn_name_comp_get(content_name->buf, components,lsa_position+2,&origtime, &comp_size);
+		get_name_part(orig_router,content_name,components,2);
+		
+		if ( nlsr->debugging )
+			printf("Orig Time: %s\nOrig Router: %s\n",origtime,orig_router->name);
+
+		int lsa_life_time=get_time_diff(time_stamp,(char *)origtime);
+		if ( (strcmp((char *)orig_router,nlsr->router_name) == 0 && lsa_life_time < nlsr->lsa_refresh_time) || (strcmp((char *)orig_router,nlsr->router_name) != 0 && lsa_life_time < nlsr->router_dead_interval) )	
+		{
+			int is_new_cor_lsa=check_is_new_cor_lsa(orig_router->name,(char *)lst,(char *)origtime);
+			if ( is_new_cor_lsa == 1 )
+			{
+				if ( nlsr->debugging )
+					printf("New Cor LSA.....\n");	
+				get_content_by_content_name(ccn_charbuf_as_string(uri), &content_data);
+				
+				if ( nlsr->debugging )
+					printf("Content Data: %s \n",content_data);
+				process_incoming_sync_content_lsa(content_data);			
+			}
+			else
+			{
+				if ( nlsr->debugging )
+					printf("Cor LSA / Newer Cor LSA already exists in LSDB\n");
+				get_content_by_content_name(ccn_charbuf_as_string(uri), &content_data);
+				if ( nlsr->debugging )
+					printf("Content Data: %s \n",content_data);
+			}
+		}
+		else 
+		{
+			if ( nlsr->debugging )
+				printf("Lsa is older than Router LSA refresh time/ Dead Interval\n");
+		}
+
+	}
 
 	if (content_data != NULL)
 		free(content_data);
@@ -691,7 +734,6 @@
     if (prefix == NULL || topo == NULL || clause == NULL ||
         slice_name == NULL || slice_uri == NULL) {
         fprintf(stderr, "Unable to allocate required memory.\n");
-        //exit(1);
 	return -1;
     }
     
