solved problem 23, 24 and 25