diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index a166783..855b311 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -334,21 +334,19 @@
 	char command[512];
 	string Full_File = Backup_Folder + Backup_Filename;
 
-	if (!generate_md5) {
-		LOGI("MD5 disabled\n");
+	if (!generate_md5)
 		return true;
-	}
 
-	ui_print(" * Generating md5...\n");
+	ui_print(" * Generating md5...");
 
 	if (TWFunc::Path_Exists(Full_File)) {
 		sprintf(command, "cd '%s' && md5sum %s > %s.md5",Backup_Folder.c_str(), Backup_Filename.c_str(), Backup_Filename.c_str());
 		LOGI("MD5 command is: '%s'\n", command);
 		if (system(command) == 0) {
-			ui_print("....MD5 Created.\n");
+			ui_print("MD5 Created.\n");
 			return true;
 		} else {
-			ui_print("....MD5 Error.\n");
+			ui_print("MD5 Error!\n");
 			return false;
 		}
 	} else {
@@ -356,21 +354,21 @@
 		int index = 0;
 
 		sprintf(filename, "%s%03i", Full_File.c_str(), index);
-		while (TWFunc::Path_Exists(filename)) {
+		while (TWFunc::Path_Exists(filename) == true) {
 			sprintf(command, "cd '%s' && md5sum %s%03i > %s%03i.md5",Backup_Folder.c_str(), Backup_Filename.c_str(), index, Backup_Filename.c_str(), index);
 			LOGI("MD5 command is: '%s'\n", command);
-			if (system(command) == 0) {
-				ui_print("....MD5 Created.\n");
-			} else {
-				ui_print("....MD5 Error.\n");
+			if (system(command) != 0) {
+				ui_print("MD5 Error.\n");
 				return false;
 			}
 			index++;
+			sprintf(filename, "%s%03i", Full_File.c_str(), index);
 		}
 		if (index == 0) {
 			LOGE("Backup file: '%s' not found!\n", filename);
 			return false;
 		}
+		ui_print("MD5 Created.\n");
 	}
 	return true;
 }
@@ -427,10 +425,9 @@
 		return false;
 
 	DataManager::GetValue(TW_SKIP_MD5_GENERATE_VAR, do_md5);
-	if (do_md5 != 0) {
-		LOGI("MD5 creation enabled.\n");
+	if (do_md5 == 0)
 		do_md5 = true;
-	}
+
 	DataManager::GetValue(TW_BACKUPS_FOLDER_VAR, Backup_Folder);
 	DataManager::GetValue(TW_BACKUP_NAME, Backup_Name);
 	if (Backup_Name == "(Current Date)" || Backup_Name == "0") {
@@ -663,192 +660,178 @@
     return true;
 }
 
+bool TWPartitionManager::Restore_Partition(TWPartition* Part, string Restore_Name) {
+	time_t Start, Stop;
+	time(&Start);
+	if (!Part->Restore(Restore_Name))
+		return false;
+	time(&Stop);
+	ui_print("[%s done (%d seconds)]\n\n", Part->Display_Name.c_str(), (int)difftime(Stop, Start));
+	return true;
+}
+
 int TWPartitionManager::Run_Restore(string Restore_Name) {
-	int check, restore_sys, restore_data, restore_cache, restore_boot, restore_andsec, restore_sdext, restore_sp1, restore_sp2, restore_sp3;
-	TWPartition* Part;
+	int check_md5, check, partition_count = 0;
+	TWPartition* restore_sys = NULL;
+	TWPartition* restore_data = NULL;
+	TWPartition* restore_cache = NULL;
+	TWPartition* restore_boot = NULL;
+	TWPartition* restore_andsec = NULL;
+	TWPartition* restore_sdext = NULL;
+	TWPartition* restore_sp1 = NULL;
+	TWPartition* restore_sp2 = NULL;
+	TWPartition* restore_sp3 = NULL;
+	time_t rStart, rStop;
+	time(&rStart);
 
-	DataManager::GetValue(TW_SKIP_MD5_CHECK_VAR, check);
-	DataManager::GetValue(TW_RESTORE_SYSTEM_VAR, restore_sys);
-	DataManager::GetValue(TW_RESTORE_DATA_VAR, restore_data);
-	DataManager::GetValue(TW_RESTORE_CACHE_VAR, restore_cache);
-	DataManager::GetValue(TW_RESTORE_BOOT_VAR, restore_boot);
-	DataManager::GetValue(TW_RESTORE_ANDSEC_VAR, restore_andsec);
-	DataManager::GetValue(TW_RESTORE_SDEXT_VAR, restore_sdext);
-	DataManager::GetValue(TW_RESTORE_SP1_VAR, restore_sp1);
-	DataManager::GetValue(TW_RESTORE_SP2_VAR, restore_sp2);
-	DataManager::GetValue(TW_RESTORE_SP3_VAR, restore_sp3);
+	ui_print("\n[RESTORE STARTED]\n\n");
+	ui_print("Restore folder: '%s'\n", Restore_Name.c_str());
 
+	if (!Mount_Current_Storage(true))
+		return false;
+
+	DataManager::GetValue(TW_SKIP_MD5_CHECK_VAR, check_md5);
+	DataManager::GetValue(TW_RESTORE_SYSTEM_VAR, check);
 	if (check > 0) {
+		restore_sys = Find_Partition_By_Path("/system");
+		if (restore_sys == NULL) {
+			LOGE("Unable to locate system partition.\n");
+			return false;
+		}
+		partition_count++;
+	}
+	DataManager::GetValue(TW_RESTORE_DATA_VAR, check);
+	if (check > 0) {
+		restore_data = Find_Partition_By_Path("/data");
+		if (restore_data == NULL) {
+			LOGE("Unable to locate data partition.\n");
+			return false;
+		}
+		partition_count++;
+	}
+	DataManager::GetValue(TW_RESTORE_CACHE_VAR, check);
+	if (check > 0) {
+		restore_cache = Find_Partition_By_Path("/cache");
+		if (restore_cache == NULL) {
+			LOGE("Unable to locate cache partition.\n");
+			return false;
+		}
+		partition_count++;
+	}
+	DataManager::GetValue(TW_RESTORE_BOOT_VAR, check);
+	if (check > 0) {
+		restore_boot = Find_Partition_By_Path("/boot");
+		if (restore_boot == NULL) {
+			LOGE("Unable to locate boot partition.\n");
+			return false;
+		}
+		partition_count++;
+	}
+	DataManager::GetValue(TW_RESTORE_ANDSEC_VAR, check);
+	if (check > 0) {
+		restore_andsec = Find_Partition_By_Path("/and-sec");
+		if (restore_andsec == NULL) {
+			LOGE("Unable to locate android secure partition.\n");
+			return false;
+		}
+		partition_count++;
+	}
+	DataManager::GetValue(TW_RESTORE_SDEXT_VAR, check);
+	if (check > 0) {
+		restore_sdext = Find_Partition_By_Path("/sd-ext");
+		if (restore_sdext == NULL) {
+			LOGE("Unable to locate sd-ext partition.\n");
+			return false;
+		}
+		partition_count++;
+	}
+#ifdef SP1_NAME
+	DataManager::GetValue(TW_RESTORE_SP1_VAR, check);
+	if (check > 0) {
+		restore_sp1 = Find_Partition_By_Path(SP1_NAME);
+		if (restore_sp1 == NULL) {
+			LOGE("Unable to locate %s partition.\n", SP1_NAME);
+			return false;
+		}
+		partition_count++;
+	}
+#endif
+#ifdef SP2_NAME
+	DataManager::GetValue(TW_RESTORE_SP2_VAR, check);
+	if (check > 0) {
+		restore_sp2 = Find_Partition_By_Path(SP2_NAME);
+		if (restore_sp2 == NULL) {
+			LOGE("Unable to locate %s partition.\n", SP2_NAME);
+			return false;
+		}
+		partition_count++;
+	}
+#endif
+#ifdef SP3_NAME
+	DataManager::GetValue(TW_RESTORE_SP3_VAR, check);
+	if (check > 0) {
+		restore_sp3 = Find_Partition_By_Path(SP3_NAME);
+		if (restore_sp3 == NULL) {
+			LOGE("Unable to locate %s partition.\n", SP3_NAME);
+			return false;
+		}
+		partition_count++;
+	}
+#endif
+
+	if (partition_count == 0) {
+		LOGE("No partitions selected for restore.\n");
+		return false;
+	}
+
+	if (check_md5 > 0) {
 		// Check MD5 files first before restoring to ensure that all of them match before starting a restore
-		if (restore_sys > 0) {
-			Part = Find_Partition_By_Path("/system");
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate system partition.\n");
-		}
+		ui_print("Verifying MD5...\n");
+		if (restore_sys != NULL && !restore_sys->Check_MD5(Restore_Name))
+			return false;
+		if (restore_data != NULL && !restore_data->Check_MD5(Restore_Name))
+			return false;
+		if (restore_cache != NULL && !restore_cache->Check_MD5(Restore_Name))
+			return false;
+		if (restore_boot != NULL && !restore_boot->Check_MD5(Restore_Name))
+			return false;
+		if (restore_andsec != NULL && !restore_andsec->Check_MD5(Restore_Name))
+			return false;
+		if (restore_sdext != NULL && !restore_sdext->Check_MD5(Restore_Name))
+			return false;
+		if (restore_sp1 != NULL && !restore_sp1->Check_MD5(Restore_Name))
+			return false;
+		if (restore_sp2 != NULL && !restore_sp2->Check_MD5(Restore_Name))
+			return false;
+		if (restore_sp3 != NULL && !restore_sp3->Check_MD5(Restore_Name))
+			return false;
+		ui_print("Done verifying MD5.\n");
+	} else
+			ui_print("Skipping MD5 check based on user setting.\n");
 
-		if (restore_data > 0) {
-			Part = Find_Partition_By_Path("/data");
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate data partition.\n");
-		}
+	ui_print("Restoring %i partitions...\n", partition_count);
+	if (restore_sys != NULL && !Restore_Partition(restore_sys, Restore_Name))
+		return false;
+	if (restore_data != NULL && !Restore_Partition(restore_data, Restore_Name))
+		return false;
+	if (restore_cache != NULL && !Restore_Partition(restore_cache, Restore_Name))
+		return false;
+	if (restore_boot != NULL && !Restore_Partition(restore_boot, Restore_Name))
+		return false;
+	if (restore_andsec != NULL && !Restore_Partition(restore_andsec, Restore_Name))
+		return false;
+	if (restore_sdext != NULL && !Restore_Partition(restore_sdext, Restore_Name))
+		return false;
+	if (restore_sp1 != NULL && !Restore_Partition(restore_sp1, Restore_Name))
+		return false;
+	if (restore_sp2 != NULL && !Restore_Partition(restore_sp2, Restore_Name))
+		return false;
+	if (restore_sp3 != NULL && !Restore_Partition(restore_sp3, Restore_Name))
+		return false;
 
-		if (restore_cache > 0) {
-			Part = Find_Partition_By_Path("/cache");
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate cache partition.\n");
-		}
-
-		if (restore_boot > 0) {
-			Part = Find_Partition_By_Path("/boot");
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate boot partition.\n");
-		}
-
-		if (restore_andsec > 0) {
-			Part = Find_Partition_By_Path("/.android_secure");
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate android_secure partition.\n");
-		}
-
-		if (restore_sdext > 0) {
-			Part = Find_Partition_By_Path("/sd-ext");
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate sd-ext partition.\n");
-		}
-#ifdef SP1_NAME
-		if (restore_sp1 > 0) {
-			Part = Find_Partition_By_Path(TWFunc::Get_Root_Path(SP1_NAME));
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate %s partition.\n", SP1_NAME);
-		}
-#endif
-#ifdef SP2_NAME
-		if (restore_sp2 > 0) {
-			Part = Find_Partition_By_Path(TWFunc::Get_Root_Path(SP2_NAME));
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate %s partition.\n", SP2_NAME);
-		}
-#endif
-#ifdef SP3_NAME
-		if (restore_sp3 > 0) {
-			Part = Find_Partition_By_Path(TWFunc::Get_Root_Path(SP3_NAME));
-			if (Part) {
-				if (!Part->Check_MD5(Restore_Name))
-					return false;
-			} else
-				LOGE("Restore: Unable to locate %s partition.\n", SP3_NAME);
-		}
-#endif
-	}
-
-	if (restore_sys > 0) {
-		Part = Find_Partition_By_Path("/system");
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate system partition.\n");
-	}
-
-	if (restore_data > 0) {
-		Part = Find_Partition_By_Path("/data");
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate data partition.\n");
-	}
-
-	if (restore_cache > 0) {
-		Part = Find_Partition_By_Path("/cache");
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate cache partition.\n");
-	}
-
-	if (restore_boot > 0) {
-		Part = Find_Partition_By_Path("/boot");
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate boot partition.\n");
-	}
-
-	if (restore_andsec > 0) {
-		Part = Find_Partition_By_Path("/.android_secure");
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate android_secure partition.\n");
-	}
-
-	if (restore_sdext > 0) {
-		Part = Find_Partition_By_Path("/sd-ext");
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate sd-ext partition.\n");
-	}
-#ifdef SP1_NAME
-	if (restore_sp1 > 0) {
-		Part = Find_Partition_By_Path(TWFunc::Get_Root_Path(SP1_NAME));
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate %s partition.\n", SP1_NAME);
-	}
-#endif
-#ifdef SP2_NAME
-	if (restore_sp2 > 0) {
-		Part = Find_Partition_By_Path(TWFunc::Get_Root_Path(SP2_NAME));
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate %s partition.\n", SP2_NAME);
-	}
-#endif
-#ifdef SP3_NAME
-	if (restore_sp3 > 0) {
-		Part = Find_Partition_By_Path(TWFunc::Get_Root_Path(SP3_NAME));
-		if (Part) {
-			if (!Part->Restore(Restore_Name))
-				return false;
-		} else
-			LOGE("Restore: Unable to locate %s partition.\n", SP3_NAME);
-	}
-#endif
 	Update_System_Details();
+	time(&rStop);
+	ui_print("[RESTORE COMPLETED IN %d SECONDS]\n\n",(int)difftime(rStop,rStart));
 	return true;
 }
 
@@ -1247,4 +1230,4 @@
 	__system("./sbin/fix_permissions.sh");
 	ui_print("Done.\n\n");
 	return true;
-}
\ No newline at end of file
+}
