YAPHANK - Residents of Yaphank who have been coping with a stinky situation for years are hopeful that they may finally get some relief.

Long Island Compost has been an unwanted neighbor for many residents because of its overwhelming odor. But a new agreement between the company, the state Department of Environmental Conservation and a coalition of 28 community groups is set to yield a major upgrade to the facility: essentially, an odor-eating machine.

The project would enclose a large portion of the facility and construct an anaerobic digester, which uses microorganisms to break down waste materials. Long Island Compost CEO Charles Vigliotti says the digester will keep food waste out of landfills while producing organic fertilizer and renewable energy.

That energy, Vigliotti says, will be converted to electricity to run the facility. Any excess power will be converted to compressed natural gas to power the company's fleet.

Recycling expert Neil Seldman tells News 12 that the technology is cost-effective and environmentally sensitive, but cautions that there's lots of work ahead. "Like any big facility, it has to be designed, built and monitored properly to protect the community from odors and methane gas," he says.

The $50 million project would be paid for by Long Island Compost.

The DEC and neighborhood groups are calling the agreement historic, but they add that it won't be completed for about 18 months.