Added the trimming flag
Merge pull request #1 from justMaku/trimming-enabled

Trimming based on flag.