chapter 9 mid
before chapter 10 refactor
test