Add improvements from end of chapter 7 exercises