Move parallelization to each former while-loop