assignment7 (chapter8 functions, part2)