Completed problem 1