Moved check for weight cost to correct place.