Added parallel implementation