 			FlxG.state.add(upperLayer = new FlxGroup());
 		}
 		
+		private function addWire(w:Wire, fixed:Boolean = true):void {
+			w.FIXED = fixed;
+			Wire.place(w);
+			
+			var displayWire:DWire = new DWire(w);
+			midLayer.add(displayWire);
+			displayWires.push(displayWire);
+		}
+		
 		private function addModule(m:Module, fixed:Boolean = true):void {
 			if (!m) return;
 			

		}
		
		protected function makeUI():void {
			makeUndoButtons();
			upperLayer.add(new DTime(FlxG.width / 2 - 50, 10));
			upperLayer.add(new Scroller);
		}
		
		protected function makeUndoButtons():void {

			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;
