Updated based on exercises for Chapter 6