Added a TPL version of the algorithm.