trimming for bsmooth