code upload

Not sure if this matches the book code but should get everything working
for chapter 3