implemented some smoothing and normalization