Added the sorting by frequency of data