sorting (by number of appearances) implemented.