started converting chapter 24 examples to Swift