Better way to compile list of words