Add extra credit code to exercise 9.