keep track of unique words
sort input words