problem 18
problem 21 and 22