Better proxy selection algorithm.