improved parallelization within nmode_b.py by changing how we wait for processes to finish. We now loop and check whether any process is not alive rather than picking one and waiting for it to finish