adding chp 2 code