remove trailing spaces throughout