Solutions for exercises 2.7 and 2.8