Completed implementation of problem 8.

Need to adjust input to problem 8 before solving.