first working prototype
update for chapter 3