Added sort by frequency alphabetically function