finished problem 3