More chapter 3 examples on flow control