Bacterial digestion and wastewater treatment