trimming
scripted update of code from master at 0307f22 trimming