anchor.diff:  		Tloc = target.loc
   
   	var/delayfraction = round(delay/numticks)
  +	
   	var/atom/Uloc = user.loc
  +	
   	var/holding = user.get_active_hand()
   	var/holdingnull = 1 //User is not holding anything
   	if(holding)
   		holdingnull = 0 //User is holding a tool of some kind
  +		
   	var/image/progbar
  +	
  +	var/continue_looping = 1 
   	for (var/i = 1 to numticks)
   		if(user.client && progress)
   			progbar = make_progress_bar(i, numticks, target)
  -			if(progbar)
  -				user.client.images |= progbar
  +			assign_progress_bar(user, progbar)
  +		
   		sleep(delayfraction)
   		if(!user || user.stat || user.weakened || user.stunned  || !(user.loc == Uloc))
  -			if(user && user.client && progbar)
  -				user.client.images -= progbar
  -			return 0
  -
  -		if(Tloc && (!target || Tloc != target.loc)) //Tloc not set when we don't want to track target
  -			if(user && user.client && progbar)
  -				user.client.images -= progbar
  -			return 0 // Target no longer exists or has moved
  -
  -		if(needhand)
  +			continue_looping = 0
  +
  +		if(continue_looping && Tloc && (!target || Tloc != target.loc)) //Tloc not set when we don't want to track target
  +			continue_looping = 0
  +
  +		if(continue_looping && needhand)
   			//This might seem like an odd check, but you can still need a hand even when it's empty
   			//i.e the hand is used to insert some item/tool into the construction
   			if(!holdingnull)
   				if(!holding)
  -					if(user && user.client && progbar)
  -						user.client.images -= progbar
  -					return 0
  -			if(user.get_active_hand() != holding)
  -				if(user && user.client && progbar)
  -					user.client.images -= progbar
  -				return 0
  -			if(user && user.client && progbar)
  -				user.client.images -= progbar
  -		if(user && user.client && progbar)
  -			user.client.images -= progbar
  -	if(user && user.client && progbar)
  -		user.client.images -= progbar
  +					continue_looping = 0
  +			if(continue_looping && user.get_active_hand() != holding)
  +				continue_looping = 0
  +		
  +		cancel_progress_bar(user, progbar)//Clear the way for the next progbar image
  +		if(!continue_looping)
  +			return 0
  +	
  +	cancel_progress_bar(user,progbar)
   	return 1
   
   //Takes: Anything that could possibly have variables and a varname to check.
  
positive.code: 		progbar.icon_state = "prog_bar_[round(((current_number / goal_number) * 100), 10)]"
  		progbar.pixel_y = 32
  		return progbar
  
  /proc/do_after(mob/user, delay, numticks = 5, needhand = 1, atom/target = null, progress = 1)
  	if(!user)
  
negative.code: 	var/holding = user.get_active_hand()
  	var/timefraction = round(time/numticks)
  	var/image/progbar
  	var/continue_looping = 1
  	for(var/i = 1 to numticks)
  		if(user.client && progress)
  			progbar = make_progress_bar(i, numticks, target)
  			assign_progress_bar(user, progbar)
  		sleep(timefraction)
  		if(!user || !target)
  			continue_looping = 0
  			
  		if (continue_looping && !uninterruptible && (user.loc != user_loc || target.loc != target_loc || user.get_active_hand() != holding || user.incapacitated() || user.lying ))
  			continue_looping = 0
  		
  		cancel_progress_bar(user, progbar)//Clear the way for the next progbar image
  		if(!continue_looping)
  			return 0
  			
  	cancel_progress_bar(user, progbar)
  	return 1
  
  /proc/make_progress_bar(current_number, goal_number, atom/target)
  