removing residuals