Add functionality from chapter 10 exercises