Added extra bonus functions from chapter 7