completed parallelization of code