diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index 23641f7..88d54ac 100644
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -109,58 +109,8 @@
 				ui_print("command is: '%s' and there is no value\n", command);
 			}
 			if (strcmp(command, "install") == 0) {
-				// Install zip
-				string ret_string;
-
-				PartitionManager.Mount_All_Storage();
-				if (value[0] != '/') {
-					// Relative path given
-					char full_path[SCRIPT_COMMAND_SIZE];
-
-					sprintf(full_path, "%s/%s", DataManager_GetCurrentStoragePath(), value);
-					LOGI("Full zip path: '%s'\n", full_path);
-					if (!TWFunc::Path_Exists(full_path)) {
-						ret_string = Locate_Zip_File(full_path, DataManager_GetCurrentStoragePath());
-						if (!ret_string.empty()) {
-							strcpy(full_path, ret_string.c_str());
-						} else if (DataManager_GetIntValue(TW_HAS_DUAL_STORAGE)) {
-							if (DataManager_GetIntValue(TW_USE_EXTERNAL_STORAGE)) {
-								LOGI("Zip file not found on external storage, trying internal...\n");
-								DataManager_SetIntValue(TW_USE_EXTERNAL_STORAGE, 0);
-							} else {
-								LOGI("Zip file not found on internal storage, trying external...\n");
-								DataManager_SetIntValue(TW_USE_EXTERNAL_STORAGE, 1);
-							}
-							sprintf(full_path, "%s/%s", DataManager_GetCurrentStoragePath(), value);
-							LOGI("Full zip path: '%s'\n", full_path);
-							ret_string = Locate_Zip_File(full_path, DataManager_GetCurrentStoragePath());
-							if (!ret_string.empty())
-								strcpy(full_path, ret_string.c_str());
-						}
-					}
-					strcpy(value, full_path);
-				} else {
-					// Full path given
-					if (!TWFunc::Path_Exists(value)) {
-						ret_string = Locate_Zip_File(value, DataManager_GetCurrentStoragePath());
-						if (!ret_string.empty())
-							strcpy(value, ret_string.c_str());
-					}
-				}
-				int wipe_cache = 0;
-				if (!TWFunc::Path_Exists(value)) {
-					// zip file doesn't exist
-					ui_print("Unable to locate zip file '%s'.\n", value);
-					ret_val = 1;
-				} else {
-					ui_print("Installing zip file '%s'\n", value);
-					ret_val = TWinstall_zip(value, &wipe_cache);
-				}
-				if (ret_val != 0) {
-					LOGE("Error installing zip file '%s'\n", value);
-					ret_val = 1;
-				} else if (wipe_cache)
-					PartitionManager.Wipe_By_Path("/cache");
+				// Install Zip
+				ret_val = Install_Command(value);
 			} else if (strcmp(command, "wipe") == 0) {
 				// Wipe
 				if (strcmp(value, "cache") == 0 || strcmp(value, "/cache") == 0) {
@@ -207,67 +157,7 @@
 					strcpy(empt, "(Current Date)");
 					DataManager_SetStrValue(TW_BACKUP_NAME, empt);
 				}
-
-				DataManager_SetIntValue(TW_BACKUP_SYSTEM_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_DATA_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_CACHE_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_RECOVERY_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_SP1_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_SP2_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_SP3_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_BOOT_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_ANDSEC_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_SDEXT_VAR, 0);
-				DataManager_SetIntValue(TW_BACKUP_SDEXT_VAR, 0);
-				DataManager_SetIntValue(TW_USE_COMPRESSION_VAR, 0);
-				DataManager_SetIntValue(TW_SKIP_MD5_GENERATE_VAR, 0);
-
-				ui_print("Setting backup options:\n");
-				line_len = strlen(value1);
-				for (i=0; i<line_len; i++) {
-					if (value1[i] == 'S' || value1[i] == 's') {
-						DataManager_SetIntValue(TW_BACKUP_SYSTEM_VAR, 1);
-						ui_print("System\n");
-					} else if (value1[i] == 'D' || value1[i] == 'd') {
-						DataManager_SetIntValue(TW_BACKUP_DATA_VAR, 1);
-						ui_print("Data\n");
-					} else if (value1[i] == 'C' || value1[i] == 'c') {
-						DataManager_SetIntValue(TW_BACKUP_CACHE_VAR, 1);
-						ui_print("Cache\n");
-					} else if (value1[i] == 'R' || value1[i] == 'r') {
-						DataManager_SetIntValue(TW_BACKUP_RECOVERY_VAR, 1);
-						ui_print("Recovery\n");
-					} else if (value1[i] == '1') {
-						DataManager_SetIntValue(TW_BACKUP_SP1_VAR, 1);
-						ui_print("%s\n", "Special1");
-					} else if (value1[i] == '2') {
-						DataManager_SetIntValue(TW_BACKUP_SP2_VAR, 1);
-						ui_print("%s\n", "Special2");
-					} else if (value1[i] == '3') {
-						DataManager_SetIntValue(TW_BACKUP_SP3_VAR, 1);
-						ui_print("%s\n", "Special3");
-					} else if (value1[i] == 'B' || value1[i] == 'b') {
-						DataManager_SetIntValue(TW_BACKUP_BOOT_VAR, 1);
-						ui_print("Boot\n");
-					} else if (value1[i] == 'A' || value1[i] == 'a') {
-						DataManager_SetIntValue(TW_BACKUP_ANDSEC_VAR, 1);
-						ui_print("Android Secure\n");
-					} else if (value1[i] == 'E' || value1[i] == 'e') {
-						DataManager_SetIntValue(TW_BACKUP_SDEXT_VAR, 1);
-						ui_print("SD-Ext\n");
-					} else if (value1[i] == 'O' || value1[i] == 'o') {
-						DataManager_SetIntValue(TW_USE_COMPRESSION_VAR, 1);
-						ui_print("Compression is on\n");
-					} else if (value1[i] == 'M' || value1[i] == 'm') {
-						DataManager_SetIntValue(TW_SKIP_MD5_GENERATE_VAR, 1);
-						ui_print("MD5 Generation is off\n");
-					}
-				}
-				if (!PartitionManager.Run_Backup()) {
-					ret_val = 1;
-					LOGE("Backup failed!\n");
-				} else
-					ui_print("Backup complete!\n");
+				ret_val = Backup_Command(value1);
 			} else if (strcmp(command, "restore") == 0) {
 				// Restore
 				PartitionManager.Mount_All_Storage();
@@ -457,6 +347,66 @@
 	return ret_val;
 }
 
+int OpenRecoveryScript::Install_Command(string Zip) {
+	// Install zip
+	string ret_string;
+	int ret_val = 0, wipe_cache = 0;
+
+	PartitionManager.Mount_All_Storage();
+	if (Zip.substr(0, 1) != "/") {
+		// Relative path given
+		string Full_Path;
+
+		Full_Path = DataManager_GetCurrentStoragePath();
+		Full_Path += "/" + Zip;
+		LOGI("Full zip path: '%s'\n", Full_Path.c_str());
+		if (!TWFunc::Path_Exists(Full_Path)) {
+			ret_string = Locate_Zip_File(Full_Path, DataManager_GetCurrentStoragePath());
+			if (!ret_string.empty()) {
+				Full_Path = ret_string;
+			} else if (DataManager_GetIntValue(TW_HAS_DUAL_STORAGE)) {
+				if (DataManager_GetIntValue(TW_USE_EXTERNAL_STORAGE)) {
+					LOGI("Zip file not found on external storage, trying internal...\n");
+					DataManager_SetIntValue(TW_USE_EXTERNAL_STORAGE, 0);
+				} else {
+					LOGI("Zip file not found on internal storage, trying external...\n");
+					DataManager_SetIntValue(TW_USE_EXTERNAL_STORAGE, 1);
+				}
+				Full_Path = DataManager_GetCurrentStoragePath();
+				Full_Path += "/" + Zip;
+				LOGI("Full zip path: '%s'\n", Full_Path.c_str());
+				ret_string = Locate_Zip_File(Full_Path, DataManager_GetCurrentStoragePath());
+				if (!ret_string.empty())
+					Full_Path = ret_string;
+			}
+		}
+		Zip = Full_Path;
+	} else {
+		// Full path given
+		if (!TWFunc::Path_Exists(Zip)) {
+			ret_string = Locate_Zip_File(Zip, DataManager_GetCurrentStoragePath());
+			if (!ret_string.empty())
+				Zip = ret_string;
+		}
+	}
+
+	if (!TWFunc::Path_Exists(Zip)) {
+		// zip file doesn't exist
+		ui_print("Unable to locate zip file '%s'.\n", Zip.c_str());
+		ret_val = 1;
+	} else {
+		ui_print("Installing zip file '%s'\n", Zip.c_str());
+		ret_val = TWinstall_zip(Zip.c_str(), &wipe_cache);
+	}
+	if (ret_val != 0) {
+		LOGE("Error installing zip file '%s'\n", Zip.c_str());
+		ret_val = 1;
+	} else if (wipe_cache)
+		PartitionManager.Wipe_By_Path("/cache");
+
+	return ret_val;
+}
+
 string OpenRecoveryScript::Locate_Zip_File(string Zip, string Storage_Root) {
 	string Path = TWFunc::Get_Path(Zip);
 	string File = TWFunc::Get_Filename(Zip);
@@ -477,4 +427,73 @@
 		pos = Path.find("/", pos + 1);
 	}
 	return "";
-}
\ No newline at end of file
+}
+
+int OpenRecoveryScript::Backup_Command(string Options) {
+	char value1[SCRIPT_COMMAND_SIZE];
+	int line_len, i;
+
+	strcpy(value1, Options.c_str());
+
+	DataManager_SetIntValue(TW_BACKUP_SYSTEM_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_DATA_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_CACHE_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_RECOVERY_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_SP1_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_SP2_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_SP3_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_BOOT_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_ANDSEC_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_SDEXT_VAR, 0);
+	DataManager_SetIntValue(TW_BACKUP_SDEXT_VAR, 0);
+	DataManager_SetIntValue(TW_USE_COMPRESSION_VAR, 0);
+	DataManager_SetIntValue(TW_SKIP_MD5_GENERATE_VAR, 0);
+
+	ui_print("Setting backup options:\n");
+	line_len = Options.size();
+	for (i=0; i<line_len; i++) {
+		if (Options.substr(i, 1) == "S" || Options.substr(i, 1) == "s") {
+			DataManager_SetIntValue(TW_BACKUP_SYSTEM_VAR, 1);
+			ui_print("System\n");
+		} else if (Options.substr(i, 1) == "D" || Options.substr(i, 1) == "d") {
+			DataManager_SetIntValue(TW_BACKUP_DATA_VAR, 1);
+			ui_print("Data\n");
+		} else if (Options.substr(i, 1) == "C" || Options.substr(i, 1) == "c") {
+			DataManager_SetIntValue(TW_BACKUP_CACHE_VAR, 1);
+			ui_print("Cache\n");
+		} else if (Options.substr(i, 1) == "R" || Options.substr(i, 1) == "r") {
+			DataManager_SetIntValue(TW_BACKUP_RECOVERY_VAR, 1);
+			ui_print("Recovery\n");
+		} else if (Options.substr(i, 1) == "1") {
+			DataManager_SetIntValue(TW_BACKUP_SP1_VAR, 1);
+			ui_print("%s\n", "Special1");
+		} else if (Options.substr(i, 1) == "2") {
+			DataManager_SetIntValue(TW_BACKUP_SP2_VAR, 1);
+			ui_print("%s\n", "Special2");
+		} else if (Options.substr(i, 1) == "3") {
+			DataManager_SetIntValue(TW_BACKUP_SP3_VAR, 1);
+			ui_print("%s\n", "Special3");
+		} else if (Options.substr(i, 1) == "B" || Options.substr(i, 1) == "b") {
+			DataManager_SetIntValue(TW_BACKUP_BOOT_VAR, 1);
+			ui_print("Boot\n");
+		} else if (Options.substr(i, 1) == "A" || Options.substr(i, 1) == "a") {
+			DataManager_SetIntValue(TW_BACKUP_ANDSEC_VAR, 1);
+			ui_print("Android Secure\n");
+		} else if (Options.substr(i, 1) == "E" || Options.substr(i, 1) == "e") {
+			DataManager_SetIntValue(TW_BACKUP_SDEXT_VAR, 1);
+			ui_print("SD-Ext\n");
+		} else if (Options.substr(i, 1) == "O" || Options.substr(i, 1) == "o") {
+			DataManager_SetIntValue(TW_USE_COMPRESSION_VAR, 1);
+			ui_print("Compression is on\n");
+		} else if (Options.substr(i, 1) == "M" || Options.substr(i, 1) == "m") {
+			DataManager_SetIntValue(TW_SKIP_MD5_GENERATE_VAR, 1);
+			ui_print("MD5 Generation is off\n");
+		}
+	}
+	if (!PartitionManager.Run_Backup()) {
+		LOGE("Backup failed!\n");
+		return 1;
+	}
+	ui_print("Backup complete!\n");
+	return 0;
+}
diff --git a/openrecoveryscript.hpp b/openrecoveryscript.hpp
index 6b21054..ca0ea9f 100644
--- a/openrecoveryscript.hpp
+++ b/openrecoveryscript.hpp
@@ -33,9 +33,9 @@
 public:
 	static int check_for_script_file();                                            // Checks to see if the ORS file is present in /cache
 	static int run_script_file();                                                  // Executes the commands in the ORS file
-
-private:
+	static int Install_Command(string Zip);                                        // Installs a zip
 	static string Locate_Zip_File(string Path, string File);                       // Attempts to locate the zip file in storage
+	static int Backup_Command(string Options);                                     // Runs a backup
 
 };
 
diff --git a/recovery.cpp b/recovery.cpp
index 1e1d9a9..ea085d1 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -69,6 +69,7 @@
   { "wipe_cache", no_argument, NULL, 'c' },
   { "show_text", no_argument, NULL, 't' },
   { "just_exit", no_argument, NULL, 'x' },
+  { "nandroid", no_argument, NULL, 'n' },
   { NULL, 0, NULL, 0 },
 };
 
@@ -829,6 +830,7 @@
     const char *update_package = NULL;
     int wipe_data = 0, wipe_cache = 0;
     bool just_exit = false;
+	bool perform_backup = false;
 
     int arg;
     while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {
@@ -840,6 +842,7 @@
         case 'c': wipe_cache = 1; break;
         case 't': ui->ShowText(true); break;
         case 'x': just_exit = true; break;
+        case 'n': perform_backup = true; LOGI("nandroid\n"); break;
         case '?':
             LOGE("Invalid command argument\n");
             continue;
@@ -899,8 +902,22 @@
 
     int status = INSTALL_SUCCESS;
 
+	if (perform_backup) {
+		char empt[50];
+		gui_console_only();
+		strcpy(empt, "(Current Date)");
+		DataManager_SetStrValue(TW_BACKUP_NAME, empt);
+		if (OpenRecoveryScript::Backup_Command("BSDCAE") != 0)
+			status = INSTALL_ERROR;
+	}
+	if (status == INSTALL_SUCCESS) { // Prevent other actions if backup failed
     if (update_package != NULL) {
 		gui_console_only();
+		if (OpenRecoveryScript::Install_Command(update_package) == 0)
+			status = INSTALL_SUCCESS;
+		else
+			status = INSTALL_ERROR;
+		/*
         status = install_package(update_package, &wipe_cache, TEMPORARY_INSTALL_FILE);
         if (status == INSTALL_SUCCESS && wipe_cache) {
             if (erase_volume("/cache")) {
@@ -908,12 +925,15 @@
             }
         }
         if (status != INSTALL_SUCCESS) ui->Print("Installation aborted.\n");
+		*/
     } else if (wipe_data) {
 		gui_console_only();
-		if (PartitionManager.Factory_Reset()) status = INSTALL_ERROR;
-        //if (device->WipeData()) status = INSTALL_ERROR;
-        //if (erase_volume("/data")) status = INSTALL_ERROR;
-        //if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR;
+		if (!PartitionManager.Factory_Reset()) status = INSTALL_ERROR;
+		/*
+        if (device->WipeData()) status = INSTALL_ERROR;
+        if (erase_volume("/data")) status = INSTALL_ERROR;
+        if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR;
+		*/
         if (status != INSTALL_SUCCESS) ui->Print("Data wipe failed.\n");
     } else if (wipe_cache) {
 		gui_console_only();
@@ -922,6 +942,7 @@
     } else if (!just_exit) {
         status = INSTALL_ERROR;  // No command specified
     }
+	}
 
     //if (status != INSTALL_SUCCESS) ui->SetBackground(RecoveryUI::ERROR);
     if (status != INSTALL_SUCCESS /*|| ui->IsTextVisible()*/) {
@@ -930,7 +951,7 @@
 		if (DataManager_GetIntValue(TW_IS_ENCRYPTED) == 0 && OpenRecoveryScript::check_for_script_file()) {
 			gui_console_only();
 			OpenRecoveryScript::run_script_file();
-			if (1 || OpenRecoveryScript::run_script_file() != 0) {
+			if (OpenRecoveryScript::run_script_file() != 0) {
 				// There was an error, boot the recovery
 				gui_start();
 			} else {
