using external sort