add denoising function