anchor.diff:  			break
   	return !i
   
  -/obj/structure/table/proc/construct_item(mob/user, datum/table_recipe/TR)
  +/obj/structure/table/proc/construct_item(mob/user, datum/table_recipe/R)
   	check_table()
  -	if(check_contents(TR) && check_tools(user, TR))
  -		if(do_after(user, TR.time))
  -			if(!check_contents(TR) || !check_tools(user, TR))
  +	if(check_contents(R) && check_tools(user, R))
  +		if(do_after(user, R.time))
  +			if(!check_contents(R) || !check_tools(user, R))
   				return 0
  -			var/list/parts = del_reqs(TR)
  -			var/atom/movable/I = new TR.result_path
  +			var/list/parts = del_reqs(R)
  +			var/atom/movable/I = new R.result_path
   			for(var/A in parts)
   				if(istype(A, /obj/item))
   					var/atom/movable/B = A
  
positive.code: 
  /obj/structure/table/proc/check_contents(datum/table_recipe/R)
  	check_table()
  	var/I = R.reqs.len
  	var/i = R.reqs.len
  	for(var/A in R.reqs)
  		var/AP = text2path(A)
  		if(!ispath(AP))
  			for(var/B in table_contents)
  				if(!ispath(B))
  					if(table_contents[B] >= R.reqs[A])
  						i--
  						break
  			I--
  			if(i > I)
  				return 0
  			else
  				continue
  		for(var/B in table_contents)
  			var/BP = text2path(B)
  			if(ispath(BP, AP))
  				if(table_contents[B] >= R.reqs[A])
  					i--
  					break
  		I--
  		if(i > I)
  			return 0
  	for(var/A in R.chem_catalists)
  		if(table_contents[A] < R.chem_catalists[A])
  			return 0
  	return !i
  
  /obj/structure/table/proc/check_table()
  	table_contents = list()
  	for(var/obj/item/I in loc)
  		if(istype(I, /obj/item/stack))
  			var/obj/item/stack/S = I
  			table_contents["[I.type]"] += S.amount   //(table_contents[I.type] ? (table_contents[I.type] + S.amount) : S.amount)
  		else
  			if(istype(I, /obj/item/weapon/reagent_containers))
  				for(var/datum/reagent/R in I.reagents.reagent_list)
  					table_contents["[R.type]"] += R.volume
  
  			table_contents["[I.type]"] += 1 //(table_contents[I.type] ? (table_contents[I.type] + 1) : 1)
  
  /obj/structure/table/proc/check_tools(mob/user, datum/table_recipe/TR)
  	if(!TR.tools.len)
  		return 1
  	var/list/possible_tools = list()
  	for(var/obj/item/I in user.contents)
  		if(istype(I, /obj/item/weapon/storage))
  			for(var/obj/item/SI in I.contents)
  				possible_tools += (SI.type)
  		else
  			possible_tools += (I.type)
  	for(var/obj/item/TI in loc)
  		possible_tools |= (TI.type)
  	var/i = TR.tools.len
  	var/I
  	for(var/A in TR.tools)
  		I = possible_tools.Find(A)
  		if(I)
  			possible_tools.Cut(I, I+1)
  
negative.code: 
  /obj/structure/table/proc/del_reqs(datum/table_recipe/R)
  	var/list/Deletion = list()
  	var/amt
  	for(var/A in R.reqs)
  		amt = R.reqs[A]
  		if(ispath(A, /obj/item/stack))
  			var/obj/item/stack/S
  			stack_loop:
  				for(var/B in table_contents)
  					if(ispath(B, A))
  						while(amt > 0)
  							S = locate(B) in loc
  							if(S.amount >= amt)
  								S.use(amt)
  								break stack_loop
  							else
  								amt -= S.amount
  								del(S)
  		else if(ispath(A, /obj/item))
  			var/obj/item/I
  			item_loop:
  				for(var/B in table_contents)
  					if(ispath(B, A))
  						while(amt > 0)
  							I = locate(B) in loc
  							Deletion.Add(I)
  							amt--
  						break item_loop
  		else
  			var/datum/reagent/RG = new A
  			reagent_loop:
  				for(var/B in table_contents)
  					if(ispath(B, /obj/item/weapon/reagent_containers))
  						var/obj/item/RC = locate(B) in loc
  						if(RC.reagents.has_reagent(RG.id, amt))
  							RC.reagents.remove_reagent(RG.id, amt)
  							RG.volume = amt
  