Working on trimmer, not sure what do
Fixed code errors in perturbation