chapter04 functions