added trim_trailing_whitespace option