removed sort_logic