cleaned up parallelization