diff --git a/macbook.conf b/macbook.conf
index b4d4791..da4dfe1 100644
--- a/macbook.conf
+++ b/macbook.conf
@@ -1,5 +1,5 @@
 router-name /ndn/memphis.edu/netlab/macbook
-ccnneighbor /ndn/memphis.edu/netlab/pollux face37 10
+ccnneighbor /ndn/memphis.edu/netlab/pollux face9 10
 ccnneighbor /ndn/memphis.edu/netlab/maia face35 15
 ccnname /ndn/memphis.edu/netlab/macbook/name1
 ccnname /ndn/memphis.edu/netlab/macbook/test
diff --git a/nlsr.c b/nlsr.c
index b2b7eb9..70a99a6 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -34,6 +34,7 @@
 {           \
     if ((resval) < 0) { \
         nlsr_destroy(); \
+	exit(1);\
     } \
 }
 
@@ -41,7 +42,7 @@
 #define ON_ERROR_EXIT(resval) \
 {           \
     if ((resval) < 0) { \
-        exit(-1); \
+        exit(1); \
     } \
 }
 
@@ -81,12 +82,24 @@
     NULL
 };
 
+void
+nlsr_lock(void)
+{
+	nlsr->semaphor=NLSR_LOCKED;
+}
+
+void
+nlsr_unlock(void)
+{
+	nlsr->semaphor=NLSR_UNLOCKED;
+}
 
 void 
 nlsr_stop_signal_handler(int sig)
 {
 	signal(sig, SIG_IGN);
- 	nlsr_destroy();	
+ 	nlsr_destroy();
+	exit(0);	
 }
 
 void 
@@ -220,7 +233,10 @@
 	}
 
 	seconds=atoi(secs);
-	nlsr->lsdb_synch_interval=seconds;
+	if ( seconds >= 120 && seconds <= 3600 )
+	{
+		nlsr->lsdb_synch_interval=seconds;
+	}
 
 }
 
@@ -235,18 +251,21 @@
 	}
 	char *rem;
 	const char *sep=" \t\n";
-	char *secs;
-	long int seconds;
+	char *retry;
+	long int retry_number;
 	
-	secs=strtok_r(command,sep,&rem);
-	if(secs==NULL)
+	retry=strtok_r(command,sep,&rem);
+	if(retry==NULL)
 	{
 		printf(" Wrong Command Format ( interest-retry number)\n");
 		return;
 	}
 
-	seconds=atoi(secs);
-	nlsr->interest_retry=seconds;
+	retry_number=atoi(retry);
+	if ( retry_number >= 1 && retry_number<=10 )
+	{
+		nlsr->interest_retry=retry_number;
+	}
 
 }
 
@@ -271,8 +290,10 @@
 	}
 
 	seconds=atoi(secs);
-	nlsr->interest_resend_time=seconds;
-
+	if ( seconds <= 60 && seconds >= 1 )
+	{
+		nlsr->interest_resend_time=seconds;
+	}
 }
 
 
@@ -459,7 +480,7 @@
 	nlsr->interest_retry = INTEREST_RETRY;
 	nlsr->interest_resend_time = INTEREST_RESEND_TIME;
 
-	nlsr->semaphor=0;
+	nlsr->semaphor=NLSR_UNLOCKED;
 
 	return 0;
 }
@@ -470,7 +491,7 @@
 {
     	int res, ret;
     	char *config_file;
-	int daemon_mode;
+	//int daemon_mode;
 
 	ret=init_nlsr();	
     	ON_ERROR_EXIT(ret);
@@ -480,7 +501,7 @@
         	switch (res) 
 		{
 			case 'd':
-				daemon_mode = 1;
+				//daemon_mode = 1;
 				break;
 			case 'f':
 				config_file = optarg;
@@ -528,20 +549,24 @@
 
 	nlsr->sched = ccn_schedule_create(nlsr, &ndn_rtr_ticker);
 	nlsr->event_send_info_interest = ccn_schedule_event(nlsr->sched, 1, &send_info_interest, NULL, 0);
+	nlsr->event = ccn_schedule_event(nlsr->sched, 60000000, &refresh_lsdb, NULL, 0);
 
 	while(1)
 	{	
-		if( nlsr->sched != NULL )
+		if ( nlsr->semaphor == NLSR_UNLOCKED  )
 		{
-			ccn_schedule_run(nlsr->sched);
-		}
-		if(nlsr->ccn != NULL)
-		{
-        		res = ccn_run(nlsr->ccn, 500);
-		}
-		if (!(nlsr->sched && nlsr->ccn))
-		{	      
-			break;
+			if( nlsr->sched != NULL )
+			{
+				ccn_schedule_run(nlsr->sched);
+			}
+			if(nlsr->ccn != NULL)
+			{
+        			res = ccn_run(nlsr->ccn, 500);
+			}
+			if (!(nlsr->sched && nlsr->ccn))
+			{	      
+				break;
+			}
 		}
 
 	}
diff --git a/nlsr.h b/nlsr.h
index 1bfc5b6..95087d3 100644
--- a/nlsr.h
+++ b/nlsr.h
@@ -5,6 +5,8 @@
 #define LSDB_SYNCH_INTERVAL 300
 #define INTEREST_RETRY 3
 #define INTEREST_RESEND_TIME 15
+#define NLSR_LOCKED 1
+#define NLSR_UNLOCKED 0
 
 struct name_prefix
 {
@@ -79,6 +81,9 @@
 void process_conf_command(char *command);
 int readConfigFile(const char *filename);
 
+void nlsr_lock(void);
+void nlsr_unlock(void);
+
 int init_nlsr(void);
 void nlsr_destroy( void );
 void nlsr_stop_signal_handler(int sig);
diff --git a/nlsr_lsdb.c b/nlsr_lsdb.c
index f271e50..f80a2b7 100644
--- a/nlsr_lsdb.c
+++ b/nlsr_lsdb.c
@@ -137,92 +137,186 @@
 void 
 install_name_lsa(struct nlsa *name_lsa)
 {
-	
-	char lst[2];
-	memset(lst,0,2);
-	sprintf(lst,"%d",name_lsa->header->ls_type);	
 
-	char lsid[10];
-	memset(lsid,0,10);
-	sprintf(lsid,"%ld",name_lsa->header->ls_id);
+	char *time_stamp=(char *)malloc(20);
+	memset(time_stamp,0,20);
+	get_current_timestamp_micro(time_stamp);
+	long int lsa_life_time=get_time_diff(time_stamp,name_lsa->header->orig_time);
+
+	printf("time difference: %ld \n",lsa_life_time);
+	
+
+		char lst[2];
+		memset(lst,0,2);
+		sprintf(lst,"%d",name_lsa->header->ls_type);	
+
+		char lsid[10];
+		memset(lsid,0,10);
+		sprintf(lsid,"%ld",name_lsa->header->ls_id);
 	
 	
-	char *key=(char *)malloc(strlen(name_lsa->header->orig_router->name)+1+strlen(lst)+1+strlen(lsid)+1);
-	memset(key,0,strlen(name_lsa->header->orig_router->name)+1+strlen(lst)+1+strlen(lsid)+1);
+		char *key=(char *)malloc(strlen(name_lsa->header->orig_router->name)+1+strlen(lst)+1+strlen(lsid)+1);
+		memset(key,0,strlen(name_lsa->header->orig_router->name)+1+strlen(lst)+1+strlen(lsid)+1);
 
 
-	make_name_lsa_key(key, name_lsa->header->orig_router->name,name_lsa->header->ls_type,name_lsa->header->ls_id);	
-	printf("Key:%s Length:%d\n",key,(int)strlen(key));
+		make_name_lsa_key(key, name_lsa->header->orig_router->name,name_lsa->header->ls_type,name_lsa->header->ls_id);	
+		printf("Key:%s Length:%d\n",key,(int)strlen(key));
 
-	struct nlsa *new_name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa )); //free
+		struct nlsa *new_name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa )); //free
 
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee; 	
-    	int res;
+		struct hashtb_enumerator ee;
+    		struct hashtb_enumerator *e = &ee; 	
+    		int res;
 
-   	hashtb_start(nlsr->lsdb->name_lsdb, e);
-    	res = hashtb_seek(e, key, strlen(key), 0);
+   		hashtb_start(nlsr->lsdb->name_lsdb, e);
+    		res = hashtb_seek(e, key, strlen(key), 0);
 
-	if(res == HT_NEW_ENTRY )
-	{
-		printf("New Name LSA... Adding to LSDB\n");
-		new_name_lsa = e->data;
-
-		new_name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header )); //free
-		new_name_lsa->header->ls_type=name_lsa->header->ls_type;
-
-		new_name_lsa->header->orig_time=(char *)malloc(strlen(name_lsa->header->orig_time)+1);
-		memset(new_name_lsa->header->orig_time,0,strlen(name_lsa->header->orig_time)+1);
-		memcpy(new_name_lsa->header->orig_time,name_lsa->header->orig_time,strlen(name_lsa->header->orig_time)+1);
-
-		new_name_lsa->header->ls_id=name_lsa->header->ls_id;
-		new_name_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix )); //free
-		new_name_lsa->header->orig_router->name=(char *)malloc(name_lsa->header->orig_router->length);
-		memcpy(new_name_lsa->header->orig_router->name,name_lsa->header->orig_router->name,name_lsa->header->orig_router->length);
-		new_name_lsa->header->orig_router->length=name_lsa->header->orig_router->length;
-		new_name_lsa->header->isValid=name_lsa->header->isValid;
-
-	
-		new_name_lsa->name_prefix=(struct name_prefix *)malloc(sizeof(struct name_prefix )); //free
-		new_name_lsa->name_prefix->name=(char *)malloc(name_lsa->name_prefix->length);
-		memcpy(new_name_lsa->name_prefix->name,name_lsa->name_prefix->name,name_lsa->name_prefix->length);
-		new_name_lsa->name_prefix->length=name_lsa->name_prefix->length;
-
-		printf("New Name LSA Added....\n");	
-
-		printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
-		set_new_lsdb_version();	
-		printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);	
-
-		int next_hop=get_next_hop(new_name_lsa->header->orig_router->name);
-		if ( next_hop == NO_NEXT_HOP )
+		if(res == HT_NEW_ENTRY )
 		{
-			int check=add_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name,NO_FACE);
-			if ( check == HT_NEW_ENTRY )
+				
+	
+		
+		
+			printf("New Name LSA... Adding to LSDB\n");
+			new_name_lsa = e->data;
+
+			new_name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header )); //free
+			new_name_lsa->header->ls_type=name_lsa->header->ls_type;
+
+			new_name_lsa->header->orig_time=(char *)malloc(strlen(name_lsa->header->orig_time)+1);
+			memset(new_name_lsa->header->orig_time,0,strlen(name_lsa->header->orig_time)+1);
+			memcpy(new_name_lsa->header->orig_time,name_lsa->header->orig_time,strlen(name_lsa->header->orig_time)+1);
+
+			new_name_lsa->header->ls_id=name_lsa->header->ls_id;
+			new_name_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix )); //free
+			new_name_lsa->header->orig_router->name=(char *)malloc(name_lsa->header->orig_router->length);
+			memcpy(new_name_lsa->header->orig_router->name,name_lsa->header->orig_router->name,name_lsa->header->orig_router->length);
+			new_name_lsa->header->orig_router->length=name_lsa->header->orig_router->length;
+			new_name_lsa->header->isValid=name_lsa->header->isValid;
+
+	
+			new_name_lsa->name_prefix=(struct name_prefix *)malloc(sizeof(struct name_prefix )); //free
+			new_name_lsa->name_prefix->name=(char *)malloc(name_lsa->name_prefix->length);
+			memcpy(new_name_lsa->name_prefix->name,name_lsa->name_prefix->name,name_lsa->name_prefix->length);
+			new_name_lsa->name_prefix->length=name_lsa->name_prefix->length;
+
+			printf("New Name LSA Added....\n");	
+
+			printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
+			set_new_lsdb_version();	
+			printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);	
+
+			int next_hop=get_next_hop(new_name_lsa->header->orig_router->name);
+			if ( next_hop == NO_NEXT_HOP )
 			{
-				printf("Added in npt \n");
+				int check=add_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name,NO_FACE);
+				if ( check == HT_NEW_ENTRY )
+				{
+					printf("Added in npt \n");
+				}
 			}
-		}
-		else 
-		{
-			int check=add_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name,next_hop);
-			if ( check == HT_NEW_ENTRY )
+			else 
 			{
-				printf("Added in npt \n");
+				int check=add_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name,next_hop);
+				if ( check == HT_NEW_ENTRY )
+				{
+					printf("Added in npt \n");
+				}
+
 			}
 
+		
+		free(time_stamp);
+
+		}
+		else if(res == HT_OLD_ENTRY)
+		{
+			new_name_lsa=e->data;
+			if(strcmp(name_lsa->header->orig_time,new_name_lsa->header->orig_time)<=0)
+			{
+				printf("Older/Duplicate Adj LSA. Discarded...\n");
+			}
+			else 
+			{
+				if ( name_lsa->header->isValid == 0 )
+				{
+					// have to call to delete npt table entry
+					delete_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name);
+				
+					if ( strcmp(name_lsa->header->orig_router->name,nlsr->router_name)!= 0)
+					{
+						hashtb_delete(e);
+						printf("isValid bit not set for Router %s so LSA Deleted from LSDB\n",name_lsa->header->orig_router->name);
+					}
+					else 
+					{
+						new_name_lsa->header->isValid=name_lsa->header->isValid;
+						free(new_name_lsa->header->orig_time);
+						new_name_lsa->header->orig_time=(char *)malloc(strlen(name_lsa->header->orig_time)+1);
+						memset(new_name_lsa->header->orig_time,0,strlen(name_lsa->header->orig_time)+1);
+						memcpy(new_name_lsa->header->orig_time,name_lsa->header->orig_time,strlen(name_lsa->header->orig_time)+1);
+					}
+					printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
+					set_new_lsdb_version();	
+					printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
+				}
+				else
+				{
+					int is_npt_update=0;
+					if ( strcmp(new_name_lsa->name_prefix->name,name_lsa->name_prefix->name) != 0 )
+					{
+						is_npt_update=1;
+						delete_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name);
+					}
+
+					// copying LSA content with header
+
+					free(new_name_lsa->header->orig_time);
+					new_name_lsa->header->orig_time=(char *)malloc(strlen(name_lsa->header->orig_time)+1);
+					memset(new_name_lsa->header->orig_time,0,strlen(name_lsa->header->orig_time)+1);
+					memcpy(new_name_lsa->header->orig_time,name_lsa->header->orig_time,strlen(name_lsa->header->orig_time)+1);
+				
+					new_name_lsa->header->isValid=name_lsa->header->isValid;
+
+					free(new_name_lsa->name_prefix->name);
+					free(new_name_lsa->name_prefix);
+					new_name_lsa->name_prefix=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+					new_name_lsa->name_prefix->name=(char *)malloc(name_lsa->name_prefix->length);
+					memcpy(new_name_lsa->name_prefix->name,name_lsa->name_prefix->name,name_lsa->name_prefix->length);
+					new_name_lsa->name_prefix->length=name_lsa->name_prefix->length;
+
+					printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
+					set_new_lsdb_version();	
+					printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
+
+					if( is_npt_update == 1 )
+					{
+						int next_hop=get_next_hop(new_name_lsa->header->orig_router->name);
+						if ( next_hop == NO_NEXT_HOP )
+						{
+							int check=add_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name,NO_FACE);
+							if ( check == HT_NEW_ENTRY )
+							{
+								printf("Added in npt \n");
+							}
+						}
+						else 
+						{
+							int check=add_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name,next_hop);
+							if ( check == HT_NEW_ENTRY )
+							{
+								printf("Added in npt \n");
+							}
+						}
+					}
+				}
+			}
+		
 		}
 
-	}
-	else if(res == HT_OLD_ENTRY)
-	{
-		printf("Duplicate Name LSA. Discarded...\n");
+    		hashtb_end(e);
 
-	}
-
-    	hashtb_end(e);
-
-	free(key);
+		free(key);
 }
 
 
@@ -320,6 +414,8 @@
 }
 
 
+
+
 void 
 make_adj_lsa_key(char *key,struct alsa *adj_lsa)
 {
@@ -334,6 +430,13 @@
 int
 build_and_install_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
 {
+	if(flags == CCN_SCHEDULE_CANCEL)
+	{
+ 	 	return -1;
+	}
+
+	nlsr_lock();
+
 	printf("build_and_install_adj_lsa called \n");
 
 	printf("adj_build_flag = %d \n",nlsr->adj_build_flag);
@@ -362,6 +465,9 @@
 		}
 	}
 	nlsr->is_build_adj_lsa_sheduled=0;
+
+	nlsr_unlock();
+
 	return 0;
 }
 
@@ -397,40 +503,6 @@
 	/* Filling Up Body Data */
 
 	adj_lsa->no_link=no_link;
-/*
-	struct link *templ=(struct link *)malloc(2*sizeof(struct link));
-	adj_lsa->links=templ;
-
-	int i, adl_element;
-	struct ndn_neighbor *nbr;
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-    	hashtb_start(nlsr->adl, e);
-	adl_element=hashtb_n(nlsr->adl);
-
-	for(i=0;i<adl_element;i++)
-	{
-		nbr=e->data;
-		if( nbr->status	== 1 )
-		{
-			struct link *temp=(struct link *)malloc(sizeof(struct link));
-			temp->nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix));
-			temp->nbr->name=(char *)malloc(nbr->neighbor->length);
-			memset(temp->nbr->name,0,nbr->neighbor->length);		
-			memcpy(temp->nbr->name,nbr->neighbor->name,nbr->neighbor->length);
-
-			temp->nbr->length=nbr->neighbor->length;
-			temp->face=nbr->face;
-			temp->metric=nbr->metric;
-
-			templ=temp;
-			templ++;
-		}	
-		hashtb_next(e);		
-	}
-
-	hashtb_end(e);
-*/
 
 
 	struct ccn_charbuf *c=ccn_charbuf_create();
@@ -461,68 +533,48 @@
 {
 	printf("install_adj_lsa called \n");
 
-	char *key=(char *)malloc(adj_lsa->header->orig_router->length+2+2);
-	memset(key,0,adj_lsa->header->orig_router->length+2);
-	make_adj_lsa_key(key,adj_lsa);
-	printf("Adjacent LSA key: %s \n",key);
 
-	struct alsa *new_adj_lsa=(struct alsa*)malloc(sizeof(struct alsa ));
+	char *time_stamp=(char *)malloc(20);
+	memset(time_stamp,0,20);
+	get_current_timestamp_micro(time_stamp);
+	long int lsa_life_time=get_time_diff(time_stamp,adj_lsa->header->orig_time);
 
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee; 	
-    	int res;
+	printf("time difference: %ld \n",lsa_life_time);
 
-   	hashtb_start(nlsr->lsdb->adj_lsdb, e);
-    	res = hashtb_seek(e, key, strlen(key), 0);
+
+		char *key=(char *)malloc(adj_lsa->header->orig_router->length+2+2);
+		memset(key,0,adj_lsa->header->orig_router->length+2);
+		make_adj_lsa_key(key,adj_lsa);
+		printf("Adjacent LSA key: %s \n",key);
+
+		struct alsa *new_adj_lsa=(struct alsa*)malloc(sizeof(struct alsa ));
+
+		struct hashtb_enumerator ee;
+    		struct hashtb_enumerator *e = &ee; 	
+    		int res;
+
+   		hashtb_start(nlsr->lsdb->adj_lsdb, e);
+    		res = hashtb_seek(e, key, strlen(key), 0);
 
 
 
-	if(res == HT_NEW_ENTRY )
-	{
-		printf("New ADJ LSA... Adding to LSDB\n");
-		new_adj_lsa = e->data;
-
-		new_adj_lsa->header=(struct alsa_header *)malloc(sizeof(struct alsa_header ));
-		new_adj_lsa->header->ls_type=adj_lsa->header->ls_type;
-		new_adj_lsa->header->orig_time=(char *)malloc(strlen(adj_lsa->header->orig_time)+1);
-		memcpy(new_adj_lsa->header->orig_time,adj_lsa->header->orig_time,strlen(adj_lsa->header->orig_time)+1);		
-
-		new_adj_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
-		new_adj_lsa->header->orig_router->name=(char *)malloc(adj_lsa->header->orig_router->length);
-		memcpy(new_adj_lsa->header->orig_router->name,adj_lsa->header->orig_router->name,adj_lsa->header->orig_router->length);
-		new_adj_lsa->header->orig_router->length=adj_lsa->header->orig_router->length;
-
-		new_adj_lsa->no_link=adj_lsa->no_link;
-		
-		new_adj_lsa->body=(char *)malloc(strlen(adj_lsa->body)+1);
-		memset(new_adj_lsa->body,0,strlen(adj_lsa->body)+1);
-		memcpy(new_adj_lsa->body,adj_lsa->body,strlen(adj_lsa->body)+1);
-
-		printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
-		set_new_lsdb_version();	
-		printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
-
-		add_next_hop_router(new_adj_lsa->header->orig_router->name);
-
-		add_next_hop_from_lsa_adj_body(new_adj_lsa->body,new_adj_lsa->no_link);
-	}
-	else if(res == HT_OLD_ENTRY)
-	{
-		new_adj_lsa = e->data;
-		if(strcmp(adj_lsa->header->orig_time,new_adj_lsa->header->orig_time)<=0)
+		if(res == HT_NEW_ENTRY )
 		{
-			printf("Older/Duplicate Adj LSA. Discarded...\n");
-		}
-		else
-		{
+			printf("New ADJ LSA... Adding to LSDB\n");
 			new_adj_lsa = e->data;
 
-			free(new_adj_lsa->header->orig_time);
+			new_adj_lsa->header=(struct alsa_header *)malloc(sizeof(struct alsa_header ));
+			new_adj_lsa->header->ls_type=adj_lsa->header->ls_type;
 			new_adj_lsa->header->orig_time=(char *)malloc(strlen(adj_lsa->header->orig_time)+1);
-			memcpy(new_adj_lsa->header->orig_time,adj_lsa->header->orig_time,strlen(adj_lsa->header->orig_time)+1);
+			memcpy(new_adj_lsa->header->orig_time,adj_lsa->header->orig_time,strlen(adj_lsa->header->orig_time)+1);		
+
+			new_adj_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+			new_adj_lsa->header->orig_router->name=(char *)malloc(adj_lsa->header->orig_router->length);
+			memcpy(new_adj_lsa->header->orig_router->name,adj_lsa->header->orig_router->name,adj_lsa->header->orig_router->length);
+			new_adj_lsa->header->orig_router->length=adj_lsa->header->orig_router->length;
 
 			new_adj_lsa->no_link=adj_lsa->no_link;
-			
+		
 			new_adj_lsa->body=(char *)malloc(strlen(adj_lsa->body)+1);
 			memset(new_adj_lsa->body,0,strlen(adj_lsa->body)+1);
 			memcpy(new_adj_lsa->body,adj_lsa->body,strlen(adj_lsa->body)+1);
@@ -531,19 +583,52 @@
 			set_new_lsdb_version();	
 			printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
 
-			add_next_hop_from_lsa_adj_body(new_adj_lsa->body,new_adj_lsa->no_link);
+			add_next_hop_router(new_adj_lsa->header->orig_router->name);
 
+			add_next_hop_from_lsa_adj_body(new_adj_lsa->body,new_adj_lsa->no_link);
+		}
+		else if(res == HT_OLD_ENTRY)
+		{
+			new_adj_lsa = e->data;
+			if(strcmp(adj_lsa->header->orig_time,new_adj_lsa->header->orig_time)<=0)
+			{
+				printf("Older/Duplicate Adj LSA. Discarded...\n");
+			}
+			else
+			{
+				new_adj_lsa = e->data;
+
+				free(new_adj_lsa->header->orig_time);
+				new_adj_lsa->header->orig_time=(char *)malloc(strlen(adj_lsa->header->orig_time)+1);
+				memcpy(new_adj_lsa->header->orig_time,adj_lsa->header->orig_time,strlen(adj_lsa->header->orig_time)+1);
+
+				new_adj_lsa->no_link=adj_lsa->no_link;
+				
+				new_adj_lsa->body=(char *)malloc(strlen(adj_lsa->body)+1);
+				memset(new_adj_lsa->body,0,strlen(adj_lsa->body)+1);
+				memcpy(new_adj_lsa->body,adj_lsa->body,strlen(adj_lsa->body)+1);
+
+				printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
+				set_new_lsdb_version();	
+				printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
+
+				add_next_hop_from_lsa_adj_body(new_adj_lsa->body,new_adj_lsa->no_link);
+
+			}
+	
+		}
+	    	hashtb_end(e);
+
+		if ( !nlsr->is_route_calculation_scheduled )
+		{
+			nlsr->event_calculate_route = ccn_schedule_event(nlsr->sched, 1000000, &route_calculate, NULL, 0);
+			nlsr->is_route_calculation_scheduled=1;
 		}
 
-	}
-    	hashtb_end(e);
 
-	if ( !nlsr->is_route_calculation_scheduled )
-	{
-		nlsr->event_calculate_route = ccn_schedule_event(nlsr->sched, 1000000, &route_calculate, NULL, 0);
-		nlsr->is_route_calculation_scheduled=1;
-	}
-	free(key);
+		free(key);
+
+	free(time_stamp);
 }
 
 void 
@@ -1065,3 +1150,101 @@
 
 	hashtb_end(e);
 }
+
+void
+refresh_name_lsdb(void)
+{
+	printf("refresh_name_lsdb called \n");
+
+	char *time_stamp=(char *)malloc(20);
+	memset(time_stamp,0,20);
+	get_current_timestamp_micro(time_stamp);
+	
+	long int lsa_life_time;
+		
+	int i, name_lsdb_element;
+	struct nlsa *name_lsa;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->lsdb->name_lsdb, e);
+	name_lsdb_element=hashtb_n(nlsr->lsdb->name_lsdb);
+
+	for(i=0;i<name_lsdb_element;i++)
+	{
+		name_lsa=e->data;
+
+		lsa_life_time=get_time_diff(time_stamp,name_lsa->header->orig_time);
+		printf("LSA Life Time: %ld \n",lsa_life_time);			
+
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+	
+	free(time_stamp);
+	
+}
+
+int
+refresh_adj_lsdb(void)
+{
+	printf("refresh_adj_lsdb called \n");
+
+	char *time_stamp=(char *)malloc(20);
+	memset(time_stamp,0,20);
+	get_current_timestamp_micro(time_stamp);
+	
+	long int lsa_life_time;
+		
+	int i, adj_lsdb_element;
+	struct alsa *adj_lsa;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+	adj_lsdb_element=hashtb_n(nlsr->lsdb->adj_lsdb);
+
+	for(i=0;i<adj_lsdb_element;i++)
+	{
+		adj_lsa=e->data;
+
+		lsa_life_time=get_time_diff(time_stamp,adj_lsa->header->orig_time);
+		printf("LSA Life Time: %ld \n",lsa_life_time);			
+
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+	
+	free(time_stamp);
+
+	return 0;
+}
+
+int
+refresh_lsdb(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
+{
+	if(flags == CCN_SCHEDULE_CANCEL)
+	{
+ 	 	return -1;
+	}
+
+	nlsr_lock();
+	printf("refresh_lsdb called \n");
+	
+	refresh_name_lsdb();
+	refresh_adj_lsdb();
+
+	if ( !nlsr->is_route_calculation_scheduled )
+	{
+		nlsr->event_calculate_route = ccn_schedule_event(nlsr->sched, 1000000, &route_calculate, NULL, 0);
+		nlsr->is_route_calculation_scheduled=1;
+	}
+
+	nlsr->event = ccn_schedule_event(nlsr->sched, 60000000, &refresh_lsdb, NULL, 0);
+	nlsr_unlock();
+	return 0;
+}
diff --git a/nlsr_lsdb.h b/nlsr_lsdb.h
index 87c4013..75f1886 100644
--- a/nlsr_lsdb.h
+++ b/nlsr_lsdb.h
@@ -54,6 +54,7 @@
 void build_and_install_others_name_lsa(char *orig_router,int ls_type,long int ls_id,char *orig_time, int isValid,char *np);
 void build_others_name_lsa(struct nlsa *name_lsa, char *orig_router,int ls_type,long int ls_id, char *orig_time, int isValid, char *np);
 void make_name_lsa_key(char *key, char *orig_router, int ls_type, long int ls_id);
+int refresh_lsdb(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
 
 int build_and_install_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
 void build_adj_lsa(struct alsa * adj_lsa);
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index bd59459..19cf893 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -192,7 +192,9 @@
 incoming_interest(struct ccn_closure *selfp,
         enum ccn_upcall_kind kind, struct ccn_upcall_info *info)
 {
-    
+
+    nlsr_lock();    
+
     switch (kind) {
         case CCN_UPCALL_FINAL:
             break;
@@ -213,6 +215,8 @@
             break;
     }
 
+     nlsr_unlock();
+
     return CCN_UPCALL_RESULT_OK;
 }
 
@@ -502,6 +506,7 @@
         enum ccn_upcall_kind kind, struct ccn_upcall_info* info)
 {
 
+     nlsr_lock();
 
     switch(kind) {
         case CCN_UPCALL_FINAL:
@@ -531,8 +536,11 @@
 	    break;
         default:
             fprintf(stderr, "Unexpected response of kind %d\n", kind);
-            return CCN_UPCALL_RESULT_ERR;
+            //return CCN_UPCALL_RESULT_ERR;
+	    break;
     }
+    
+     nlsr_unlock();
 
     return CCN_UPCALL_RESULT_OK;
 }
@@ -896,6 +904,13 @@
 int
 send_info_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
 {
+	if(flags == CCN_SCHEDULE_CANCEL)
+	{
+ 	 	return -1;
+	}
+
+         nlsr_lock();
+
 	printf("send_info_interest called \n");
 	printf("\n");
 
@@ -916,6 +931,8 @@
 	}
 	hashtb_end(e);
 
+	 nlsr_unlock();
+
 	return 0;
 }
 
@@ -991,6 +1008,8 @@
  	 	return -1;
 	}
 
+	 nlsr_lock();
+
 	int i, adl_element;
 	struct ndn_neighbor *nbr;
 
@@ -1024,6 +1043,8 @@
 	hashtb_end(e);
 	nlsr->event_send_lsdb_interest= ccn_schedule_event(nlsr->sched, 30000000, &send_lsdb_interest, NULL, 0);
 
+	 nlsr_unlock();
+
 	return 0;
 }
 
diff --git a/nlsr_npt.c b/nlsr_npt.c
index 9841da6..9fe4565 100644
--- a/nlsr_npt.c
+++ b/nlsr_npt.c
@@ -126,6 +126,59 @@
 	return res;
 }
 
+int 
+delete_npt_entry(char *orig_router, char *name_prefix)
+{
+	if ( strcmp(orig_router,nlsr->router_name)== 0)
+	{
+		return -1;
+	}
+
+	struct npt_entry *ne;
+	
+	int res,res_nle;
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee; 	
+    
+
+   	hashtb_start(nlsr->npt, e);
+    	res = hashtb_seek(e, orig_router, strlen(orig_router), 0);
+
+	if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+		return -1;
+	}
+	else if (res == HT_OLD_ENTRY)
+	{
+		ne=e->data;
+
+		struct hashtb_enumerator eenle;
+    		struct hashtb_enumerator *enle = &eenle;
+
+		hashtb_start(ne->name_list, enle);
+		res_nle = hashtb_seek(enle, name_prefix, strlen(name_prefix), 0);
+
+		if(res_nle == HT_NEW_ENTRY )
+		{
+			hashtb_delete(enle);
+		}
+		else if(res_nle == HT_OLD_ENTRY )
+		{
+			if (ne->next_hop_face != NO_FACE )
+			{
+				add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)name_prefix, OP_UNREG, ne->next_hop_face);
+			}
+			hashtb_delete(enle);
+		}
+
+		hashtb_end(enle);
+	}
+	
+	hashtb_end(e);
+
+	return 0;
+}
 
 void 
 print_npt(void)
@@ -289,11 +342,7 @@
 
 	for(i=0;i<npt_element;i++)
 	{
-		//printf("\n");
-		//printf("----------NPT ENTRY %d------------------\n",i+1);
 		ne=e->data;
-		//printf(" Origination Router: %s \n",ne->orig_router);
-		//ne->next_hop_face == NO_FACE ? printf(" Next Hop Face: NO_NEXT_HOP \n") : printf(" Next Hop Face: %d \n", ne->next_hop_face);
 		
 		int j, nl_element;
 		struct name_list_entry *nle;		
@@ -310,7 +359,7 @@
 			{
 				add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_UNREG , ne->next_hop_face);
 			}
-			//printf(" Name Prefix: %s \n",nle->name);
+			//printf(" Name Prefix: %s Face: %d \n",nle->name,ne->next_hop_face);
 			hashtb_next(enle);
 		}
 		hashtb_end(enle);
diff --git a/nlsr_npt.h b/nlsr_npt.h
index d564312..f469f24 100644
--- a/nlsr_npt.h
+++ b/nlsr_npt.h
@@ -17,6 +17,7 @@
 
 
 int add_npt_entry(char *orig_router, char *name_prefix, int face);
+int delete_npt_entry(char *orig_router, char *name_prefix);
 void print_npt(void);
 void delete_orig_router_from_npt(char *orig_router,int next_hop_face);
 void update_npt_with_new_route(char * orig_router,int next_hop_face);
diff --git a/nlsr_route.c b/nlsr_route.c
index 60e9c76..85a9b03 100644
--- a/nlsr_route.c
+++ b/nlsr_route.c
@@ -28,6 +28,14 @@
 int
 route_calculate(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
 {
+
+	if(flags == CCN_SCHEDULE_CANCEL)
+	{
+ 	 	return -1;
+	}
+
+	nlsr_lock();
+
 	printf("route_calculate called\n");
 
 	if( ! nlsr->is_build_adj_lsa_sheduled )
@@ -69,6 +77,8 @@
 
 		update_routing_table_with_new_route(parent,source);
 
+		print_routing_table();
+		print_npt();
 
 		for(i = 0; i < map_element; i++)
 		{
@@ -82,6 +92,8 @@
 	}
 	nlsr->is_route_calculation_scheduled=0;
 
+	nlsr_unlock();
+
 	return 0;
 }
 
@@ -696,6 +708,32 @@
 }
 
 void 
+update_routing_table(char * dest_router,int next_hop_face)
+{
+	int res;
+	struct routing_table_entry *rte;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->routing_table, e);
+	res = hashtb_seek(e, dest_router, strlen(dest_router), 0);
+
+	if( res == HT_OLD_ENTRY )
+	{
+		rte=e->data;
+		rte->next_hop_face=next_hop_face;
+	}
+	else if ( res == HT_OLD_ENTRY )
+	{
+		hashtb_delete(e);
+	}
+	
+	hashtb_end(e);
+	
+}
+
+void 
 print_routing_table(void)
 {
 	printf("\n");
@@ -789,7 +827,7 @@
 					//printf("Next hop router name: %s \n",next_hop_router);
 					int next_hop_face=get_next_hop_face_from_adl(next_hop_router);
 					update_npt_with_new_route(orig_router,next_hop_face);
-
+					update_routing_table(orig_router,next_hop_face);
 					printf ("Orig_router: %s Next Hop Face: %d \n",orig_router,next_hop_face);
 
 				}
diff --git a/utility.c b/utility.c
index 33f3b2e..49ad52c 100644
--- a/utility.c
+++ b/utility.c
@@ -65,11 +65,33 @@
 {
 	struct timeval now; 
 	gettimeofday(&now, NULL);
-
-	//char *microSec=(char *)malloc(20);
 	sprintf(microSec,"%ld%06ld",now.tv_sec,(long int)now.tv_usec);
-	//microSec[strlen(microSec)]='\0';
-	//return microSec;
+}
 
+
+long int
+get_time_diff(char *time1, char *time2)
+{
+	long int diff_secs;
+
+	long int time1_in_sec,	time2_in_sec;
+
+	char *time1_sec=(char *)malloc(strlen(time1)-6+1);
+	memset(time1_sec,0,strlen(time1)-6+1);
+	memcpy(time1_sec,time1,strlen(time1)-6);
+
+	char *time2_sec=(char *)malloc(strlen(time2)-6+1);
+	memset(time2_sec,0,strlen(time2)-6+1);
+	memcpy(time2_sec,time2,strlen(time2)-6);
+
+	time1_in_sec=strtol(time1_sec,NULL,10);
+	time2_in_sec=strtol(time2_sec,NULL,10);
+
+	diff_secs=time1_in_sec-time2_in_sec;
+
+	free(time1_sec);
+	free(time2_sec);
+
+	return diff_secs;
 }
 
diff --git a/utility.h b/utility.h
index fb699d6..75bf5ab 100644
--- a/utility.h
+++ b/utility.h
@@ -5,5 +5,6 @@
 char * getGmTimeStamp(void);
 long int get_current_time_sec(void);
 void get_current_timestamp_micro(char * microSec);
+long int get_time_diff(char *time1, char *time2);
 
 #endif
