sample code for ch2 part3
finish Ch2 Part3