Updated parallel implementation