finished converting chapter 19 examples to swift