problem 18 finished