minor change in probability array condition