ch02 functions