Refactored parallel and sequential processes into one loop. Still need to add timeout support.