Changing parallelism scheme.

Changing the parallelism from foreach-skip-based to for-indexed-based approach.