update sort_list from O(logN) space to O(1) space using **