began converting chapter 8 examples to Swift