added exercise 2.40 & 2.41