finished problem 6a