Adding TreeMap to sort word frquencies.