changed word data structure to support counting