Completed problem 5.2