WIP: got most of chapter 4 done