shortenTXT function