SAN FRANCISCO (CBS SF) — California’s dairy industry has managed to push back tough new regulations to reduce the amount of methane gas created by cows and their manure. But some dairies are much more progressive. One farm has been reducing its emissions for decades.

A cow’s going to do what a cow’s going to do: Eat, get milked, and create a stinky mess.

READ MORE: COVID: Fisherman's Wharf In-and-Out Burger Location Temporarily Closed for Not Checking Vax Status

But soon, dairy farmers will be looking to convert that mess, just like farmer Mike Gallo did 14 years ago. “The idea of capturing the gas, producing electricity kind of interested me,” Gallo said.

Read: Part 1 – Waste From California Dairy Farms Presents Climate Change Challenge

In 2002, Joseph Gallo Farms in the Central Valley decided to invest $2 million in what’s called a digester. It traps the methane gas from cow waste underneath thick, plastic covers. That gas makes them inflate, like giant water beds.

Most dairies don’t trap the gas. They dump the waste into ponds and let the methane escape into the atmosphere, where it’s said to be 25 times more potent than carbon dioxide as a greenhouse gas.

But for Gallo and a handful of other big dairy farms in California the trapped methane — biogas — powers the farms’ generators.

Gallo creates enough of its own electricity and steam to save the farm $3,000 to $4,000 a day.

“There’s a large power cost there and to the extent we can reduce those it makes a big difference. In addition to it we’re able to get some heat off the engines to pre-heat the water going into the boilers,” Gallo said.

READ MORE: Tearful Memories Linger 30 Years After Deadly Oakland Hills Firestorm

In addition to milking 6,000 cows, Gallo makes cheese and has to power his cheese processing and packaging plant. That makes him his own power customer. For him the digester makes economic as well as environmental sense.

Of course not all dairies in the state are large operations like Joseph Gallo Farms.

A new law says dairy farms in California must cut their methane gas emissions 40 percent by 2030.

The dairy association says the smaller dairies are the guys who might suffer under the new law.

“The smaller dairies will be forced into a very bad decision. Specifically the pasture raised and organic side, it will absolutely shut them down if they’re required to do this,” said Anja Raudabaugh with Western United Dairymen.

But digesters are expensive, even with available grant money. “Unfortunately it’ll be a lot of the smaller family farms that’ll go out because they just don’t have the resources to be able to put one of these in and operate it,” said Raudabaugh.

Gallo says that if a farmer doesn’t need all the power he or she generates, there has to be a customer for it, and right now, utilities don’t have the infrastructure to support that. But the law is the law.

MORE NEWS: UPDATE: Phish Fan Injured After Being Fallen On at SF Chase Center Concert Describes Brush with Death

“If we don’t put them in you’re going to see the dairy industry really be reduced in this state to the point I think it will surprise everybody. Some dairymen, he says, are already packing up and moving to other states.