adding hierarchial merge-sort to keep max open file descriptors under control in worst-case scenarios