anchor.diff:  /obj/structure/table/proc/del_reqs(datum/table_recipe/TR)
   	var/datum/table_recipe/R = TR
   	for(var/A in R.reqs)
  -		var/obj/item/I = locate(A) in loc
  -		if(istype(I, /obj/item/stack))
  -			var/obj/item/stack/S = I
  -			S.amount -= R.reqs[A]
  +		var/AP = text2path(A)
  +		var/BP
  +		world.log << "[A]"
  +		if(ispath(AP, /obj/item/stack))
  +			var/obj/item/stack/S
  +			for(var/B in table_contents)
  +				BP = text2path(B)
  +				if(ispath(BP, AP))
  +					S = locate(BP) in loc
  +					if(S.amount >= R.reqs[A])
  +						S.use(R.reqs[A])
  +						break
   		else
  -			for(var/i=R.reqs[A],i>=0,i--)
  -				I = locate(A) in loc
  -				del(I)
  +			var/obj/item/I
  +			for(var/B in table_contents)
  +				BP = text2path(B)
  +				if(ispath(BP, AP))
  +					I = locate(BP) in loc
  +					if(I)
  +						del(I)
  +						break
   
   /obj/structure/table/interact(mob/user)
   	check_table()
  
positive.code: 
  /datum/table_recipe
  	var/name = ""
  	var/reqs[]
  	var/result_path
  	var/tools[]
  	var/time = 0
  
  /datum/table_recipe/flame_thrower
  	name = "Flamethrower"
  	result_path = /obj/item/weapon/flamethrower
  	reqs = list(/obj/item/weapon/weldingtool = 1,
  				/obj/item/device/assembly/igniter = 1,
  				/obj/item/stack/rods = 2)
  	tools = list(/obj/item/weapon/screwdriver)
  	time = 20
  
  /obj/structure/table
  	name = "table"
  
negative.code: /obj/structure/table/proc/construct_item(mob/user, datum/table_recipe/TR)
  	check_table()
  	if(check_contents(TR) && check_tools(user, TR))
  		world.log << "Tools checked"
  		if(do_after(user, TR.time))
  			if(!check_contents(TR) || !check_tools(user, TR))
  				return 0
  			del_reqs(TR)
  			var/atom/movable/I = new TR.result_path
  			I.loc = loc
  			return 1
  	return 0
  