Updated with notes in Chapter 5 of tutorial.