Code Sample 22 (step 4)