added solutions for exercises 1.40 and 1.41