update wordfreq function