Move trim in a method.
Add flag to force saturation of weights.