Updated name selection algorithm.