trimming code