finished problem 1.