finished problem 18