Finished problem 8 in JfC