changing the whitespace replacement to include whitespace at end of lines