Updating code snippets for Chapter 5