add the random() method from chapter 5