Exercises from Chapter 3 done