Completion of Chapter 6 exercises