fix_5B integrate sort function by frequency

declare let mut entries here