finished problem 5