finished Ch12Prog2