Added sort_by_first_word method in Histogram class