Finished the execise of chapter 6