finished problem 6