update the solution for reorder list from recursive to unrecursive