Isolate sort operation from recursion