dynamic trimming