code as I go through the book