added a version for testing parallelization