smoothing and residual calculations moved to separate functions, cons. of mass passes