started to implement chap1 prog exc 2