Example 4-4, added cond statement