Added solutions for exercises 8 to 10.