 			return reactionStack.pop().execute();
 		}
 		
+		protected function save():void {
+			savedString = genSaveString();
+			U.save.data[level.name] = savedString;
+			C.log(savedString);
+		}
+		
+		protected function genSaveString():String {
+			var saveString:String = "";
+			
+			//save modules
+			var modulesExist:Boolean;
+			for each (var module:Module in modules)
+				if (module.exists && !module.FIXED) {
+					saveString += module.saveString();
+					modulesExist = true;
+				}
+			saveString += U.SAVE_DELIM;
+			if (!modulesExist)
+				saveString += U.SAVE_DELIM;
+			
+			//save wires
+			var wiresExist:Boolean;
+			for each (var wire:Wire in wires)
+				if (wire.exists) {
+					saveString += wire.saveString();
+					wiresExist = true;
+				}
+			
+			saveString += U.SAVE_DELIM;
+			if (!wiresExist)
+				saveString += U.SAVE_DELIM;
+			
+			return saveString;
+		}
+		
+		
+		protected function load():void {
+			var saveString:String = U.save.data[level.name];
+			if (!saveString)
+				return;
+			
+			var saveArray:Array = saveString.split(U.SAVE_DELIM + U.SAVE_DELIM);
+			
+			//load modules
+			var moduleStrings:String = saveArray[0];
+			if (moduleStrings.length)
+				for each (var moduleString:String in moduleStrings.split(U.SAVE_DELIM))
+					addModule(Module.fromString(moduleString), false);
+			
+			//load wires
+			var wireStrings:String = saveArray[1];
+			if (wireStrings.length)
+				for each (var wireString:String in wireStrings.split(U.SAVE_DELIM))
+					addWire(Wire.fromString(wireString), false);
+			
+			savedString = saveString;
+		}
 		
 		protected const MODE_MODULE:int = 0;
 		protected const MODE_CONNECT:int = 1;

			FlxG.state.add(upperLayer = new FlxGroup());
		}
		
		private function addModule(m:Module, fixed:Boolean = true):void {
			if (!m) return;
			

			
			for each (var module:Module in level.modules)
				addModule(module);
			load();
			
			makeUI();
		}
