Added back the parallelized code