anchor.diff:  	else
   		main_status = 2
   
  -	//if(debug)
  -		//world << "Status: [main_status] - Excess: [excess] - Last Equip: [lastused_equip] - Last Light: [lastused_light]"
  +	if(debug)
  +		log_debug("Status: [main_status] - Excess: [excess] - Last Equip: [lastused_equip] - Last Light: [lastused_light] - Longterm: [longtermpower]")
   
   	if(cell && !shorted)
  -		var/cell_charge = cell.charge
  -		var/cell_maxcharge = cell.maxcharge
  -
   		// draw power from cell as before to power the area
  -
  -		var/cellused = min(cell_charge, CELLRATE * lastused_total)	// clamp deduction to a max, amount left in cell
  +		var/cellused = min(cell.charge, CELLRATE * lastused_total)	// clamp deduction to a max, amount left in cell
   		cell.use(cellused)
   
   		if(excess > lastused_total)		// if power excess recharge the cell
  -														// by the same amount just used
  -			cell.give(cellused)
  -			add_load(cellused/CELLRATE)		// add the load used to recharge the cell
  -
  -
  +										// by the same amount just used
  +			var/draw = draw_power(cellused/CELLRATE) // draw the power needed to charge this cell
  +			cell.give(draw * CELLRATE)
   		else		// no excess, and not enough per-apc
  -
  -			if( (cell_charge/CELLRATE + excess) >= lastused_total)		// can we draw enough from cell+grid to cover last usage?
  -
  -				cell_charge = min(cell_maxcharge, cell_charge + CELLRATE * excess)	//recharge with what we can
  -				add_load(excess)		// so draw what we can from the grid
  +			if( (cell.charge/CELLRATE + excess) >= lastused_total)		// can we draw enough from cell+grid to cover last usage?
  +				var/draw = draw_power(excess)
  +				cell.charge = min(cell.maxcharge, cell.charge + CELLRATE * draw)	//recharge with what we can
   				charging = 0
  -
  -			else if (autoflag != 0)	// not enough power available to run the last tick!
  +			else	// not enough power available to run the last tick!
   				charging = 0
   				chargecount = 0
   				// This turns everything off in the case that there is still a charge left on the battery, just not enough to run the room.
  
positive.code: 				var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
  				s.set_up(3, 1, src)
  				s.start()
  				H << "\red The APC power currents surge eratically, damaging your chassis!"
  				H.adjustFireLoss(10,0)
  			else if(src.cell && src.cell.charge > 0)
  				if(H.nutrition < 450)
  
negative.code: 				user << "You [ locked ? "lock" : "unlock"] the APC interface."
  				update_icon()
  			else
  				user << "<span class='warning'>Access denied.</span>"
  	else if (istype(W, /obj/item/stack/cable_coil) && !terminal && opened && has_electronics!=2)
  		if (src.loc:intact)
  			user << "<span class='warning'>You must remove the floor plating in front of the APC first.</span>"
  			return
  		var/obj/item/stack/cable_coil/C = W
  		if(C.amount < 10)
  			user << "<span class='warning'>You need more wires.</span>"
  			return
  		user << "You start adding cables to the APC frame..."
  		playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
  		if(do_after(user, 20))
  			if (C.amount >= 10 && !terminal && opened && has_electronics != 2)
  				var/turf/T = get_turf(src)
  				var/obj/structure/cable/N = T.get_cable_node()
  				if (prob(50) && electrocute_mob(usr, N, N))
  					var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
  					s.set_up(5, 1, src)
  					s.start()
  					return
  				C.use(10)
  				user.visible_message(\
  					"<span class='warning'>[user.name] has added cables to the APC frame!</span>",\
  					"You add cables to the APC frame.")
  				make_terminal()
  				terminal.connect_to_network()
  	else if (istype(W, /obj/item/weapon/wirecutters) && terminal && opened && has_electronics!=2)
  		if (src.loc:intact)
  			user << "<span class='warning'>You must remove the floor plating in front of the APC first.</span>"
  			return
  		user << "You begin to cut the cables..."
  		playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
  		if(do_after(user, 50))
  			if(terminal && opened && has_electronics!=2)
  				if (prob(50) && electrocute_mob(usr, terminal.powernet, terminal))
  					var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
  					s.set_up(5, 1, src)
  					s.start()
  					return
  				new /obj/item/stack/cable_coil(loc,10)
  				user << "<span class='notice'>You cut the cables and dismantle the power terminal.</span>"
  				qdel(terminal) // qdel
  	else if (istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics==0 && !((stat & BROKEN) || malfhack))
  		user << "You trying to insert the power control board into the frame..."
  		playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
  		if(do_after(user, 10))
  			if(has_electronics==0)
  				has_electronics = 1
  				user << "<span class='notice'>You place the power control board inside the frame.</span>"
  				qdel(W) // qdel
  	else if (istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics==0 && ((stat & BROKEN) || malfhack))
  		user << "<span class='warning'>You cannot put the board inside, the frame is damaged.</span>"
  		return
  	else if (istype(W, /obj/item/weapon/weldingtool) && opened && has_electronics==0 && !terminal)
  		var/obj/item/weapon/weldingtool/WT = W
  		if (WT.get_fuel() < 3)
  			user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
  			return
  		user.visible_message("<span class='warning'>[user.name] welds [src].</span>", \
  							"You start welding the APC frame...", \
  							"You hear welding.")
  		playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
  		if(do_after(user, 50))
  			if(!src || !WT.remove_fuel(3, user)) return
  			if (emagged || malfhack || (stat & BROKEN) || opened==2)
  				new /obj/item/stack/sheet/metal(loc)
  				user.visible_message(\
  					"<span class='warning'>[src] has been cut apart by [user.name] with the weldingtool.</span>",\
  					"<span class='notice'>You disassembled the broken APC frame.</span>",\
  					"You hear welding.")
  			else
  				new /obj/item/mounted/frame/apc_frame(loc)
  				user.visible_message(\
  					"<span class='warning'>[src] has been cut from the wall by [user.name] with the weldingtool.</span>",\
  					"<span class='notice'>You cut the APC frame from the wall.</span>",\
  					"You hear welding.")
  			qdel(src) // qdel
  			return
  	else if (istype(W, /obj/item/mounted/frame/apc_frame) && opened && emagged)
  		emagged = 0
  		if (opened==2)
  			opened = 1
  		user.visible_message(\
  			"<span class='warning'>[user.name] has replaced the damaged APC frontal panel with a new one.</span>",\
  			"You replace the damaged APC frontal panel with a new one.")
  		qdel(W)
  		update_icon()
  