solved problem 23
solved problem 24