initial code through chapter 2