Solutions for 38,39 & 40