My code from the C++ Primer book.