Added extra credit to exercise 21