Chapter 2 and Chapter 3 exercises