The lagoon is divided into two distinct layers: sludge and liquid. The sludge layer is a more solid layer formed by the stratification of sediments from the manure.[11] After a while, this solid layer accumulates and eventually needs to be cleaned out.[8] The liquid level is composed of grease, scum and other particulates.[8] The liquid level CAFO wastewater enters at the bottom of the lagoon so that it can mix with the active microbial mass in the sludge layer. These anaerobic conditions are uniform throughout the lagoon, except in a small surface level.[11] Sometimes aeration is applied to this level to dampen the odors emitted by the lagoons. If surface aeration is not applied, a crust will form that will trap heat and odors.[11] Anaerobic lagoons should retain and treat wastewater from 20 to 150 days.[8] Lagoons should be followed by aerobic or facultative lagoons to provide further required treatment.[11] The liquid layer is periodically drained and used for fertilizer. In some instances, a cover can be provided to trap methane, which is used for energy.[11] Anaerobic Lagoons work through a process called anaerobic digestion.[5] Decomposition of the organic matter begins shortly after the animals void. Lagoons become anaerobic due to the high biological oxygen demand (BOD) of the feces, which contains a high level of soluble solids, resulting in higher BOD.[5] Anaerobic microorganisms convert organic compounds into carbon dioxide and methane through acid formation and methane production.