added ex39 and renamed ex40 & ex41