solve problem 24