count words by frequency of occurence and store in hash