finished problem 1