Tentative agreement reached with thousands of local governments and more than 20 states, could be worth up to $12 billion over time