Added example code from book.