refactor
added tests for trim trailing whitespace