finished problem 8