Completed the example in the book