ex2-6 document functions