added exercise 3.21~3.23