added functioanlity to delete trailing whitespace