modified get_word to be same spec as 'wc' command