Added ex2.40, ex2.41 and ex2.42 solutions