Completed problem 3.6