Chapter3 exercise 2