Solved exercises 2.40, 2.41, 2.42, 2.43