problem 18
prob 18