code for chap 7