the bestIndex method here seems weird to me.