Added function to remove all trailing whitespace before saving file.