Added example code chapter 7.1