Implement chapter 7 exercises