MADE SMOOTHING ALGORITHM