Solution to Problem 26, ~114 second execution time.