Began the creation of the algorithm for problem 8.