diff --git a/macbook.conf b/macbook.conf
index fbff79a..7310e35 100644
--- a/macbook.conf
+++ b/macbook.conf
@@ -1,9 +1,8 @@
 #----configuration file for macbook----------
 #
 router-name /ndn/memphis.edu/netlab/macbook
-ccnneighbor /ndn/memphis.edu/cs/maia
-#ccnneighbor /ndn/memphis.edu/cs/mira
-#ccnneighbor /ndn/memphis.edu/cs/castor
+ccnneighbor /ndn/memphis.edu/cs/gemeni
+ccnneighbor /ndn/memphis.edu/cs/altair
 ccnneighbor /ndn/memphis.edu/cs/pollux 141.225.11.132
 ccnname /ndn/memphis.edu/macbook/patterson
 ccnname /ndn/memphis.edu/macbook/houston/
diff --git a/nlsr.c b/nlsr.c
index 4f50669..b3816b5 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -162,9 +162,7 @@
 	char *rtr_name;
 	char *nbr_ip_addr;
 	int is_ip_configured=0;
-	//char *face;
 	char *ip_addr=(char *)calloc(20,sizeof(char));
-	//memset(ip_addr,0,12);
 
 	rtr_name=strtok_r(command,sep,&rem);
 	if(rtr_name==NULL)
@@ -185,7 +183,6 @@
 	}
 	struct name_prefix *nbr=(struct name_prefix *)calloc(1,sizeof(struct name_prefix ));
 	nbr->name=(char *)calloc(strlen(rtr_name)+1,sizeof(char));
-	//memset(nbr->name,0,strlen(rtr_name)+1);
 	memcpy(nbr->name,rtr_name,strlen(rtr_name)+1);
 	nbr->length=strlen(rtr_name)+1;
 
@@ -204,7 +201,7 @@
 	}
 	else
 	{
-		memcpy(ip_addr,nbr_ip_addr,strlen(nbr_ip_addr));
+		memcpy(ip_addr,nbr_ip_addr,strlen(nbr_ip_addr)+1);
 		if (nlsr->debugging)
 		{
 			printf("Name of neighbor: %s ",nbr->name);
@@ -483,8 +480,7 @@
 	}
 
 	nlsr->logDir=(char *)calloc(strlen(dir)+1,sizeof(char));
-	//memset(nlsr->logDir,0,strlen(dir)+1);
-	memcpy(nlsr->logDir,dir,strlen(dir));
+	memcpy(nlsr->logDir,dir,strlen(dir)+1);
 }
 
 	void 
@@ -564,7 +560,7 @@
 			topo_prefix[strlen(topo_prefix)-1]='\0';
 
 		nlsr->topo_prefix=(char *)calloc(strlen(topo_prefix)+1,sizeof(char));
-		memcpy(nlsr->topo_prefix,topo_prefix,strlen(topo_prefix));
+		memcpy(nlsr->topo_prefix,topo_prefix,strlen(topo_prefix)+1);
 		printf ("Topo prefix is: %s", nlsr->topo_prefix);;
 	}
 }
@@ -596,7 +592,7 @@
 			slice_prefix[strlen(slice_prefix)-1]='\0';
 
 		nlsr->slice_prefix=(char *)calloc(strlen(slice_prefix)+1,sizeof(char));
-		memcpy(nlsr->slice_prefix,slice_prefix,strlen(slice_prefix));
+		memcpy(nlsr->slice_prefix,slice_prefix,strlen(slice_prefix)+1);
 	}
 }
 
@@ -1211,7 +1207,6 @@
 	nlsr->lsdb=(struct linkStateDatabase *)malloc(sizeof(struct linkStateDatabase));
 
 	char *time_stamp=(char *) calloc (20,sizeof(char));
-	//memset(time_stamp,0,20);
 	get_current_timestamp_micro(time_stamp);
 	nlsr->lsdb->lsdb_version=(char *)malloc(strlen(time_stamp)+1);
 	memset(nlsr->lsdb->lsdb_version,0,strlen(time_stamp));
diff --git a/nlsr_adl.c b/nlsr_adl.c
index 947d5ac..6076f89 100644
--- a/nlsr_adl.c
+++ b/nlsr_adl.c
@@ -31,7 +31,7 @@
 void 
 add_nbr_to_adl(struct name_prefix *new_nbr,int face,char *ip)
 {
-	struct ndn_neighbor *nbr;//=(struct ndn_neighbor *)malloc(sizeof(struct ndn_neighbor )); //free
+	struct ndn_neighbor *nbr;
 
 	struct hashtb_enumerator ee;
     	struct hashtb_enumerator *e = &ee; 	
@@ -45,7 +45,7 @@
    
 		nbr = e->data;
 
-		nbr->neighbor=(struct name_prefix *)malloc(sizeof( struct name_prefix )); //free
+		nbr->neighbor=(struct name_prefix *)malloc(sizeof( struct name_prefix ));
 		nbr->neighbor->name=(char *)malloc(new_nbr->length);
 		memcpy(nbr->neighbor->name,new_nbr->name,new_nbr->length);
 		nbr->neighbor->length=new_nbr->length;
@@ -58,18 +58,17 @@
 		nbr->metric=LINK_METRIC;
 		nbr->is_lsdb_send_interest_scheduled=0;
 		
-		nbr->ip_address=(char *)malloc(strlen(ip)+1);
-		memset(nbr->ip_address,0,strlen(ip)+1);
-		memcpy(nbr->ip_address,ip,strlen(ip));
+		nbr->ip_address=(char *)calloc(strlen(ip)+1,sizeof(char));
+		memcpy(nbr->ip_address,ip,strlen(ip)+1);
 
 		char *time_stamp=(char *)malloc(20);
 		get_current_timestamp_micro(time_stamp);
-		nbr->last_lsdb_version=(char *)malloc(strlen(time_stamp)+1); //free
+		nbr->last_lsdb_version=(char *)calloc(strlen(time_stamp)+1,sizeof(char));
 		memcpy(nbr->last_lsdb_version,time_stamp,strlen(time_stamp)+1);
-		memset(nbr->last_lsdb_version,'0',strlen(time_stamp));
-		nbr->last_info_version=(char *)malloc(strlen(time_stamp)+1); //free
+		memset(nbr->last_lsdb_version,'0',strlen(time_stamp)+1);
+		nbr->last_info_version=(char *)calloc(strlen(time_stamp)+1,sizeof(char));
 		memcpy(nbr->last_info_version,time_stamp,strlen(time_stamp)+1);
-		memset(nbr->last_info_version,'0',strlen(time_stamp));
+		memset(nbr->last_info_version,'0',strlen(time_stamp)+1);
 		free(time_stamp);		
 
 		nbr->last_lsdb_requested=0;
@@ -399,7 +398,14 @@
 
 	if (res == HT_OLD_ENTRY)
 	{
-		hashtb_delete(e);	
+		struct ndn_neighbor *nbr=e->data;
+		free(nbr->neighbor->name);
+		free(nbr->neighbor);
+		free(nbr->last_lsdb_version);
+		free(nbr->last_info_version);
+		free(nbr->ip_address);
+		hashtb_delete(e);
+			
 	}
 	else if(res == HT_NEW_ENTRY)
 	{
@@ -535,14 +541,6 @@
 			free(temp_length);
 			ccn_charbuf_append_string(c,"|");
 
-			/*char *temp_face=(char *)malloc(20);
-			memset(temp_face,0,20);
-			sprintf(temp_face,"%d",nbr->face);
-			ccn_charbuf_append_string(c,temp_face);
-			free(temp_face);
-			ccn_charbuf_append_string(c,"|");
-			*/
-
 			char *temp_metric=(char *)malloc(20);
 			memset(temp_metric,0,20);
 			sprintf(temp_metric,"%d",nbr->metric);
@@ -557,314 +555,6 @@
 	hashtb_end(e);
 }
 
-long int
-get_nbr_time_diff_lsdb_req(char *nbr)
-{
-	if ( nlsr->debugging )
-		printf("get_nbr_time_diff_lsdb_req called\n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"get_nbr_time_diff_lsdb_req called\n");
-
-	long int time_diff=get_lsdb_synch_interval(nbr)+1;	
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-
-	if (res == HT_OLD_ENTRY)
-	{
-		nnbr=e->data;
-
-		if (nnbr->last_lsdb_requested == 0)
-			time_diff=get_lsdb_synch_interval(nbr)+1;
-		else time_diff=get_current_time_sec() - get_nbr_last_lsdb_requested(nbr);
-
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-
-	return time_diff;
-}
-
-long int 
-get_nbr_last_lsdb_requested(char *nbr)
-{
-	if ( nlsr->debugging )
-		printf("get_timed_out_number called\n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"get_timed_out_number called\n");
-
-	long int last_lsdb_requested=0;
-
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-
-	if (res == HT_OLD_ENTRY)
-	{
-		nnbr=e->data;
-		last_lsdb_requested=nnbr->last_lsdb_requested;
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-
-	return last_lsdb_requested;
-}
-
-
-int 
-get_nbr_random_time_component(char *nbr)
-{
-	if ( nlsr->debugging )
-		printf("get_nbr_random_time_component called\n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"get_nbr_random_time_component called\n");
-
-	int time=0;
-
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-
-	if (res == HT_OLD_ENTRY)
-	{
-		nnbr=e->data;
-		time=nnbr->lsdb_random_time_component * (int)pow(-1,nnbr->lsdb_interest_timed_out+1);
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-
-	return time;
-}
-
-long int 
-get_lsdb_synch_interval(char *nbr)
-{
-	if ( nlsr->debugging )
-		printf("get_lsdb_synch_interval called \n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"get_lsdb_synch_interval called \n");
-
-	long int lsdb_synch_interval=300;	
-
-
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-
-	if (res == HT_OLD_ENTRY)
-	{
-		nnbr=e->data;
-		lsdb_synch_interval=nnbr->lsdb_synch_interval;
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-
-	return lsdb_synch_interval;
-
-}
-
-char *
-get_nbr_lsdb_version(char *nbr)
-{
-	if ( nlsr->debugging )
-		printf("get_nbr_lsdb_version called \n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"get_nbr_lsdb_version called \n");
-
-	char *version=NULL;
-
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-
-	if (res == HT_OLD_ENTRY)
-	{
-		nnbr=e->data;
-		version=(char *)malloc(strlen(nnbr->last_lsdb_version)+1);
-		memset(version,0,strlen(nnbr->last_lsdb_version)+1);
-		memcpy(version,nnbr->last_lsdb_version,strlen(nnbr->last_lsdb_version)+1);
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-
-	return version;
-}
-
-void 
-update_adjacent_last_lsdb_requested_to_adl(char *nbr, long int timestamp)
-{
-	if ( nlsr->debugging )
-		printf("update_adjacent_last_lsdb_requested_to_adl called \n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"update_adjacent_last_lsdb_requested_to_adl called \n");
-
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-
-	if( res == HT_OLD_ENTRY )
-	{
-		nnbr=e->data;
-		nnbr->last_lsdb_requested=timestamp;
-
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-}
-
-void 
-set_is_lsdb_send_interest_scheduled_to_zero(char *nbr)
-{
-	if ( nlsr->debugging )
-		printf("set_is_lsdb_send_interest_scheduled_to_zero called \n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"set_is_lsdb_send_interest_scheduled_to_zero called\n");
-
-
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-
-	if (res == HT_OLD_ENTRY)
-	{
-		nnbr=e->data;
-		nnbr->is_lsdb_send_interest_scheduled=0;
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-}
-
-void 
-update_adjacent_lsdb_version_to_adl(struct name_prefix *nbr, char *version)
-{
-	if ( nlsr->debugging )
-		printf("update_adjacent_timed_out_to_adl called \n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"update_adjacent_timed_out_to_adl called\n");
-
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr->name, nbr->length, 0);
-
-	if( res == HT_OLD_ENTRY )
-	{
-		nnbr=e->data;
-		free(nnbr->last_lsdb_version);
-		nnbr->last_lsdb_version=(char *)malloc(strlen(version)+1);
-		memset(nnbr->last_lsdb_version,0,strlen(version)+1);
-		memcpy(nnbr->last_lsdb_version,version,strlen(version)+1);
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-
-}
-
-void 
-adjust_adjacent_last_lsdb_requested_to_adl(char *nbr, long int sec)
-{
-	printf("update_adjacent_last_lsdb_requested_to_adl called \n");
-
-	if ( nlsr->debugging )
-		printf("update_adjacent_last_lsdb_requested_to_adl called \n");
-	if ( nlsr->detailed_logging )
-		writeLogg(__FILE__,__FUNCTION__,__LINE__,"update_adjacent_last_lsdb_requested_to_adl called\n");
-
-
-	int res;
-	struct ndn_neighbor *nnbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-
-	if( res == HT_OLD_ENTRY )
-	{
-		nnbr=e->data;
-		nnbr->last_lsdb_requested=nnbr->last_lsdb_requested-sec;
-
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-
-}
 
 int 
 get_next_hop_face_from_adl(char *nbr)
@@ -1024,8 +714,7 @@
 
 	}
 
-	name_part->name=(char *)malloc(strlen(neighbor)+1);
-	memset(name_part->name,0,strlen(neighbor)+1);
+	name_part->name=(char *)calloc(strlen(neighbor)+1,sizeof(char));
 	memcpy(name_part->name,neighbor,strlen(neighbor)+1);
 	name_part->length=strlen(neighbor)+1;
 
diff --git a/nlsr_lsdb.c b/nlsr_lsdb.c
index 46a9428..6c18921 100644
--- a/nlsr_lsdb.c
+++ b/nlsr_lsdb.c
@@ -34,16 +34,18 @@
 void
 set_new_lsdb_version(void)
 {
-	char *time_stamp=(char *)malloc(20);
-	memset(time_stamp,0,20);
-	get_current_timestamp_micro(time_stamp);
+	//char *time_stamp=(char *)malloc(20);
+	//memset(time_stamp,0,20);
+	//get_current_timestamp_micro(time_stamp);
 	
+	char *time_stamp=get_current_timestamp_micro_v2();
 	free(nlsr->lsdb->lsdb_version);
-	nlsr->lsdb->lsdb_version=(char *)malloc(strlen(time_stamp)+1);
-	memset(nlsr->lsdb->lsdb_version,0,strlen(time_stamp)+1);
+	nlsr->lsdb->lsdb_version=(char *)calloc(strlen(time_stamp)+1,sizeof(char));
 	memcpy(nlsr->lsdb->lsdb_version,time_stamp,strlen(time_stamp)+1);
-
 	free(time_stamp);
+	//memcpy(nlsr->lsdb->lsdb_version,time_stamp,strlen(time_stamp)+1);
+
+	//free(time_stamp);
 	
 }
 
diff --git a/utility.c b/utility.c
index 0c0be75..6a7cb0c 100644
--- a/utility.c
+++ b/utility.c
@@ -62,7 +62,17 @@
 }
 
 
-
+int
+get_width_of_number(long int number)
+{
+	int i=0;
+	while(number>0)
+	{
+		i++;
+		number/=10;
+	}
+	return i;
+}
 
 long int 
 get_current_time_sec(void)
@@ -81,6 +91,18 @@
 	sprintf(microSec,"%ld%06ld",now.tv_sec,(long int)now.tv_usec);
 }
 
+char *
+get_current_timestamp_micro_v2()
+{
+	struct timeval now; 
+	gettimeofday(&now, NULL);
+	//sprintf(microSec,"%ld%06ld",now.tv_sec,(long int)now.tv_usec);
+	char *microSec=(char *)calloc(get_width_of_number(now.tv_sec)+7,sizeof(char));
+	sprintf(microSec,"%ld%06ld",now.tv_sec,(long int)now.tv_usec);
+	microSec[strlen(microSec)]='\0';	
+
+	return microSec;
+}
 
 long int
 get_time_diff(const char *time1, const char *time2)
@@ -268,9 +290,10 @@
     for(i = 0; addr_list[i] != NULL; i++)
     {
         strcpy(ip , inet_ntoa(*addr_list[i]) );
+		ip[strlen(ip)]='\0';
         return 0;
     }
-    return 1;
+    return -1;
 }
 
 
diff --git a/utility.h b/utility.h
index f90c281..bbca9f6 100644
--- a/utility.h
+++ b/utility.h
@@ -11,4 +11,5 @@
 void writeLogg(const char *source_file, const char *function, const int line, const char *format, ...);
 struct sockaddr_in * get_ip_from_hostname(char *hostname);
 int get_ip_from_hostname_02(char * hostname , char* ip);
+char * get_current_timestamp_micro_v2();
 #endif
