Exercise 8-4 (Gen.choose)