Parallelizing the calculations.