updating code to have the parallelism parameter