finished problem 2