added solution for 40