Add comment explaining _nextIdx calculation.