diff --git a/flash_rom.c b/flash_rom.c
index d0d3b80..ff99cb0 100644
--- a/flash_rom.c
+++ b/flash_rom.c
@@ -71,11 +71,11 @@
 	{"SST49LF080A",	SST_ID,		SST_49LF080A,	NULL, 1024, 4096,
 	 probe_jedec,	erase_chip_jedec, write_49lf040,NULL},
 	{"SST49LF002A",	SST_ID,		SST_49LF002A,	NULL, 256, 4096,
-	 probe_jedec,	erase_chip_jedec, write_49lf040,NULL},
+	 probe_sst_fwhub, erase_sst_fwhub, write_sst_fwhub, NULL},
 	{"SST49LF003A", SST_ID,		SST_49LF003A,	NULL, 384, 4096,
-	 probe_jedec,	erase_chip_jedec, write_49lf040,NULL},
+	 probe_sst_fwhub, erase_sst_fwhub, write_sst_fwhub,NULL},
 	{"SST49LF004A", SST_ID,		SST_49LF004A,	NULL, 512, 4096,
-	 probe_jedec,	erase_chip_jedec, write_49lf040,NULL},
+	 probe_sst_fwhub, erase_sst_fwhub, write_sst_fwhub,NULL},
 	{"SST49LF008A", SST_ID,		SST_49LF008A, 	NULL, 1024, 4096,
 	 probe_sst_fwhub, erase_sst_fwhub, write_sst_fwhub, NULL},
 #endif
@@ -250,9 +250,9 @@
 			sscanf(tempstr,"%x",&exclude_start_position);
 			break;
 		case 'e':
-                        tempstr = strdup(optarg);
-                        sscanf(tempstr,"%x",&exclude_end_position);
-                        break;
+			tempstr = strdup(optarg);
+			sscanf(tempstr,"%x",&exclude_end_position);
+			break;
 
 		default:
 			usage(argv[0]);
@@ -260,7 +260,6 @@
 		}
 	}
 
-
 	if (read_it && write_it) {
 		printf("-r and -w are mutually exclusive\n");
 		usage(argv[0]);
@@ -285,8 +284,7 @@
 
 	printf("Part is %s\n", flash->name);
 	if (!filename) {
-		printf
-		    ("OK, only ENABLING flash write, but NOT FLASHING\n");
+		printf("OK, only ENABLING flash write, but NOT FLASHING\n");
 		return 0;
 	}
 	size = flash->total_size * 1024;
@@ -303,8 +301,9 @@
 		else
 			flash->read(flash, buf);
 
-	        if(exclude_end_position - exclude_start_position > 0)  
-	                memset(buf+exclude_start_position, 0, exclude_end_position-exclude_start_position);
+		if (exclude_end_position - exclude_start_position > 0)
+			memset(buf+exclude_start_position, 0,
+			       exclude_end_position-exclude_start_position);
 
 		fwrite(buf, sizeof(char), size, image);
 		fclose(image);
@@ -318,15 +317,16 @@
 		fclose(image);
 	}
 
-	if(exclude_end_position - exclude_start_position > 0) 
-        	memcpy(buf+exclude_start_position, (const char *) flash->virt_addr+exclude_start_position, 
-			exclude_end_position-exclude_start_position);
-        
+	if (exclude_end_position - exclude_start_position > 0)
+	    memcpy(buf+exclude_start_position,
+		       (const char *) flash->virt_addr+exclude_start_position, 
+		       exclude_end_position-exclude_start_position);
+
         exclude_start_page = exclude_start_position/flash->page_size;
-        if((exclude_start_position%flash->page_size) != 0) { 
-                exclude_start_page++;
-        }       
-        exclude_end_page = exclude_end_position/flash->page_size;
+	if ((exclude_start_position%flash->page_size) != 0) {
+		exclude_start_page++;
+	}
+	exclude_end_page = exclude_end_position/flash->page_size;
 
 	if (write_it || (!read_it && !verify_it)) {
 		flash->write(flash, buf);
diff --git a/jedec.c b/jedec.c
index 19a233b..0344b69 100644
--- a/jedec.c
+++ b/jedec.c
@@ -89,6 +89,7 @@
 
 	return (0);
 }
+
 int erase_block_jedec(volatile unsigned char *bios, unsigned int block)
 {
 	volatile unsigned char *Temp;
@@ -149,43 +150,45 @@
 	return (0);
 }
 
-void write_page_write_jedec(volatile unsigned char *bios, unsigned char *src,
-			    volatile unsigned char *dst, int page_size)
+int write_page_write_jedec(volatile unsigned char *bios, unsigned char *src,
+			   volatile unsigned char *dst, int page_size)
 {
 	int i;
 
 	/* Issue JEDEC Data Unprotect comand */
-	*(volatile char *) (bios + 0x5555) = 0xAA;
-	*(volatile char *) (bios + 0x2AAA) = 0x55;
-	*(volatile char *) (bios + 0x5555) = 0xA0;
+	*(volatile unsigned char *) (bios + 0x5555) = 0xAA;
+	*(volatile unsigned char *) (bios + 0x2AAA) = 0x55;
+	*(volatile unsigned char *) (bios + 0x5555) = 0xA0;
 
+	/* transfer data from source to destination */
 	for (i = 0; i < page_size; i++) {
-		/* transfer data from source to destination */
+		/* If the data is 0xFF, don't program it */
+		if (*src == 0xFF)
+			continue;
 		*dst++ = *src++;
 	}
 
-	usleep(100);
 	toggle_ready_jedec(dst - 1);
+
+	return 0;
 }
 
 int write_byte_program_jedec(volatile unsigned char *bios, unsigned char *src,
 			     volatile unsigned char *dst)
 {
-	volatile unsigned char *Temp;
-
-	/* transfer data from source to destination */
+	/* If the data is 0xFF, don't program it */
 	if (*src == 0xFF) {
-		/* If the data is 0xFF, don't program it */
 		return 0;
 	}
+
 	/* Issue JEDEC Byte Program command */
-	Temp = bios + 0x5555;
-	*Temp = 0xAA;
-	Temp = bios + 0x2AAA;
-	*Temp = 0x55;
-	Temp = bios + 0x5555;
-	*Temp = 0xA0;
+	*(volatile unsigned char *) (bios + 0x5555) = 0xAA;
+	*(volatile unsigned char *) (bios + 0x2AAA) = 0x55;
+	*(volatile unsigned char *) (bios + 0x5555) = 0xA0;
+
+	/* transfer data from source to destination */
 	*dst = *src;
+
 	toggle_ready_jedec(bios);
 
 	return 0;
diff --git a/sst_fwhub.c b/sst_fwhub.c
index 7ab6bdb..909e394 100644
--- a/sst_fwhub.c
+++ b/sst_fwhub.c
@@ -75,19 +75,17 @@
 
 	printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
 	if (id1 != flash->manufacture_id || id2 != flash->model_id)
-	  return 0;
+		return 0;
 
 	myusec_delay(10);
 
-
-
 	// we need to mmap the write-protect space. 
 	bios = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED,
 		    flash->fd_mem, (off_t) (0 - 0x400000 - size));
 	if (bios == MAP_FAILED) {
-	  // it's this part but we can't map it ...
-	  perror("Error MMAP /dev/mem");
-	  exit(1);
+		// it's this part but we can't map it ...
+		perror("Error MMAP /dev/mem");
+		exit(1);
 	}
 
 	flash->virt_addr_2 = bios;
@@ -96,9 +94,6 @@
 
 unsigned char wait_sst_fwhub(volatile unsigned char *bios)
 {
-
-
-
 	toggle_ready_jedec(bios);
 	return 0;
 }
@@ -138,16 +133,16 @@
 	return (0);
 }
 
-void write_page_sst_fwhub(volatile char *bios, char *src, volatile char *dst,
-			int page_size)
+void write_page_sst_fwhub(volatile char *bios, char *src,
+			  volatile char *dst, int page_size)
 {
 	int i;
 
 	for (i = 0; i < page_size; i++) {
 		/* transfer data from source to destination */
-	  write_byte_program_jedec(bios, src, dst);
-	  src++;
-	  dst++;
+		write_byte_program_jedec(bios, src, dst);
+		src++;
+		dst++;
 	}
 
 }
@@ -168,7 +163,7 @@
 	for (i = 0; i < total_size / page_size; i++) {
 		printf("%04d at address: 0x%08x", i, i * page_size);
 		write_page_sst_fwhub(bios, buf + i * page_size,
-				   bios + i * page_size, page_size);
+				     bios + i * page_size, page_size);
 		printf
 		    ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
