Completed problem 3