code snippets as I work through princeton's coursera course