Working version of external sorter
Cleanup + output files