update smoothing and better limit algorithm