Implement excersises solution from chapter 5