first working version
finished chapter 3