make remove trailing whitespace a separate function
new action to remove trailing whitespace