added option to specify TRIM output directory.