Adding more comments as I walk through the logic of the example