re #fix_5B Integrate the frequency sorting feature

re #fix_5B delete useless condition

re #fix_5B refractor code

re #fix_5B delete useless code