words and chars are added to collection and occurancies of collection elements are counted