Added solutions to problem 40 and 41.