added example code to ch3_examp2