solved problenas 23 and 24