finished problem 4