Preventing pollution on the fly