added code for parallel execution