anchor.diff:  		dat += "[get_design_cost(D)]<br>"
   
   	dat += "</div>"
  +	dat += "</td>"
  +	dat += get_queue()
  +	dat += "</tr></table>"
   	return dat
   
  -/obj/machinery/autolathe/proc/can_build(var/datum/design/D)
  -	var/coeff = (ispath(D.build_path,/obj/item/stack) ? 1 : 2 ** prod_coeff)
  -
  -	if(D.materials["$metal"] && (m_amount < (D.materials["$metal"] / coeff)))
  -		return 0
  -	if(D.materials["$glass"] && (g_amount < (D.materials["$glass"] / coeff)))
  -		return 0
  -	return 1
  -
   /obj/machinery/autolathe/proc/get_design_cost(var/datum/design/D)
  -	var/coeff = (ispath(D.build_path,/obj/item/stack) ? 1 : 2 ** prod_coeff)
  +	var/coeff = get_coeff(D)
   	var/dat
   	if(D.materials["$metal"])
   		dat += "[D.materials["$metal"] / coeff] metal "
  
positive.code: 		line_length++
  
  	dat += "</tr></table></div>"
  	return dat
  
  /obj/machinery/autolathe/proc/category_win(mob/user,var/selected_category)
  	var/dat = "<A href='?src=\ref[src];menu=[AUTOLATHE_MAIN_MENU]'>Return to main menu</A>"
  	dat += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3><br>"
  	dat += "<b>Metal amount:</b> [src.m_amount] / [max_m_amount] cm<sup>3</sup><br>"
  	dat += "<b>Glass amount:</b> [src.g_amount] / [max_g_amount] cm<sup>3</sup><hr>"
  
  
negative.code: /obj/machinery/autolathe/Topic(href, href_list)
  	if(..())
  		return 1
  	if(href_list["menu"])
  		screen = text2num(href_list["menu"])
  
  	if(href_list["category"])
  		selected_category = href_list["category"]
  
  	if(href_list["make"])
  		BuildTurf = get_step(src.loc, get_dir(src,usr))
  
  		/////////////////
  		//href protection
  		being_built = files.FindDesignByID(href_list["make"]) //check if it's a valid design
  		if(!being_built)
  			return
  		if(!(being_built.build_type & AUTOLATHE))
  			return
  
  		//multiplier checks : only stacks can have one and its value is 1, 10 ,25 or max_multiplier
  		var/multiplier = text2num(href_list["multiplier"])
  		var/max_multiplier = min(50, being_built.materials["$metal"] ?round(m_amount/being_built.materials["$metal"]):INFINITY,being_built.materials["$glass"]?round(g_amount/being_built.materials["$glass"]):INFINITY)
  		var/is_stack = ispath(being_built.build_path, /obj/item/stack)
  
  		if(!is_stack && (multiplier > 1))
  			return
  		if (!(multiplier in list(1,10,25,max_multiplier))) //"enough materials ?" is checked in the build proc
  			return
  		/////////////////
  		
  		if(queue.len<queue_max_len)
  			add_to_queue(being_built,multiplier)
  		else
  			usr << "\red The autolathe queue is full!"
  		if (!busy)
  			busy = 1
  			process_queue()
  			busy = 0
  	
  	if(href_list["remove_from_queue"])
  		var/index = text2num(href_list["remove_from_queue"])
  		if(isnum(index) && IsInRange(index,1,queue.len))
  			remove_from_queue(index)
  	if(href_list["queue_move"] && href_list["index"])
  		var/index = text2num(href_list["index"])
  		var/new_index = index + text2num(href_list["queue_move"])
  		if(isnum(index) && isnum(new_index))
  			if(IsInRange(new_index,1,queue.len))
  				queue.Swap(index,new_index)
  	if(href_list["clear_queue"])
  		queue = list()
  	if(href_list["search"])
  		matching_designs.Cut()
  
  		for(var/datum/design/D in files.known_designs)
  			if(findtext(D.name,href_list["to_search"]))
  				matching_designs.Add(D)
  		
  	
  	src.updateUsrDialog()
  	
  	return
  
  /obj/machinery/autolathe/RefreshParts()
  