trimming scripts must include collapsing