Chap6 functions