solved 40 and 41
solved 40 and 41