anchor.diff:  		return
   	switch(state)
   		if(1)
  +			if(istype(P, /obj/item/weapon/circuitboard))
  +				user << "<span class='warning'>The frame needs wiring first!</span>"
  +				return
   			if(istype(P, /obj/item/stack/cable_coil))
   				var/obj/item/stack/cable_coil/C = P
   				if(C.get_amount() >= 5)
   					playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
  -					user << "<span class='notice'>You start to add cables to the frame.</span>"
  +					user << "<span class='notice'>You start to add cables to the frame...</span>"
  +					var oldloc = src.loc
   					if(do_after(user, 20))
  +						if(src.loc!=oldloc)
  +							return
   						if(C.get_amount() >= 5 && state == 1)
   							C.use(5)
   							user << "<span class='notice'>You add cables to the frame.</span>"
   							state = 2
   							icon_state = "box_1"
   				else
  -					user << "<span class='warning'>You need five length of cable to wire the frame.</span>"
  +					user << "<span class='warning'>You need five length of cable to wire the frame!</span>"
   					return
  -			if(istype(P, /obj/item/weapon/wrench))
  +			if(istype(P, /obj/item/weapon/weldingtool) && !anchored)
  +				var/obj/item/weapon/weldingtool/WT = P
  +				if(WT.remove_fuel(0,user))
  +					playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
  +					user.visible_message("<span class='warning'>[user] disassembles the frame.</span>", \
  +										"You start to disassemble the frame...", "You hear welding and clanking.")
  +					var oldloc = src.loc
  +					if(do_after(user, 40))
  +						if( !WT.isOn() )
  +							return
  +						if(src.loc!=oldloc)
  +							return
  +						user << "<span class='notice'>You disassemble the frame.</span>"
  +						var/obj/item/stack/sheet/metal/M = new (loc, 5)
  +						M.add_fingerprint(user)
  +						qdel(src)
  +			if(istype(P, /obj/item/weapon/wrench) && state == 1 && state == 2)
  +				user << "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>"
   				playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
  -				user << "<span class='notice'>You dismantle the frame.</span>"
  -				new /obj/item/stack/sheet/metal(src.loc, 5)
  -				qdel(src)
  +				var oldloc = src.loc
  +				if(do_after(user, 40))
  +					if(src.loc!=oldloc)
  +						return
  +					user << "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>"
  +					anchored = !anchored
  +
   		if(2)
   			if(istype(P, /obj/item/weapon/circuitboard))
  +				if(!anchored)
  +					user << "<span class='warning'>The frame needs to be secured first!</span>"
  +					return
   				var/obj/item/weapon/circuitboard/B = P
   				if(B.board_type == "machine")
   					playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
  
positive.code: 							/obj/item/weapon/stock_parts/manipulator = 1,
  							/obj/item/weapon/stock_parts/console_screen = 1,
  							/obj/item/weapon/stock_parts/cell = 1)
  							
  /obj/item/weapon/circuitboard/chem_master
  	name = "circuit board (Chem Master 2999)"
  	build_path = /obj/machinery/chem_master/constructable
  
negative.code: 	icon = 'icons/obj/stock_parts.dmi'
  	icon_state = "box_0"
  	density = 1
  	anchored = 0
  	use_power = 0
  	var/obj/item/weapon/circuitboard/circuit = null
  	var/list/components = null
  