added dan's use of regex to make the word frequencies