Stinking lagoons of pig poo created by thousands of animals in giant pig farms can pollute rivers, poison groundwater and pump out clouds of methane and carbon dioxide. Using microorganisms to break down slurry makes sense for two reasons. The first is environmental protection, but the methane produced by anaerobic digestion can also be used to generate electricity. The problem was that no one has been certain which way of doing it makes the most electricity for the least greenhouse gas production.