anchor.diff:  /datum/material_container/proc/get_item_material_amount(obj/item/I)
   	if(!istype(I))
   		return 0
  -	var/material_amount
  -	for(var/datum/material/M in materials)
  -		material_amount += I.materials[M.material_type]
  +	var/material_amount = 0
  +	for(var/MAT in materials)
  +		material_amount += I.materials[MAT]
   	return material_amount
   
   
  
positive.code: 	return material_amount
  
  /datum/material_container/proc/insert_materials(obj/item/I) //for internal usage only
  	for(var/datum/material/M in materials)
  		M.amount += I.materials[M.material_type]
  		total_amount += I.materials[M.material_type]
  
  //For consuming material
  /datum/material_container/proc/use_amount(list/mats)
  	if(!mats || !mats.len)
  		return 0
  
  	for(var/datum/material/M in materials)
  		if(M.amount < mats[M.material_type])
  			return 0
  
  	var/total_amount_save = total_amount
  	for(var/datum/material/M in materials)
  		M.amount -= mats[M.material_type]
  		total_amount -= mats[M.material_type]
  
  	return total_amount_save - total_amount
  
  
  /datum/material_container/proc/use_amount_type(amt, material_type)
  	for(var/datum/material/M in materials)
  		if(M.material_type == material_type)
  			if(M.amount >= amt)
  				M.amount -= amt
  				total_amount -= amt
  				return amt
  	return 0
  
  //For spawning mineral sheets
  /datum/material_container/proc/retrieve(sheet_amt, datum/material/M)
  	if(sheet_amt > 0 && M.amount >= (sheet_amt * MINERAL_MATERIAL_AMOUNT))
  		var/count = 0
  
negative.code: 
  /datum/material_container/proc/retrieve_all()
  	var/result = 0
  	var/datum/material/M
  	for(var/MAT in materials)
  		M = materials[MAT]
  		result += retrieve_sheets(amount2sheet(M.amount), MAT)
  	return result
  
  /datum/material_container/proc/has_space(amt = 0)
  