Added the algorithm to the solution.