Complete exercises from Chapter 5