sovled problem 29 - 31