Modified integrate_parallel.r