fix_5B integrate sort function by frequency

check if really necessary