solved problems 22 and 23