Chapter 4 code examples from the Khan iOS text