Added sort_menu function