Improvement to parallel implementation.