Completed problem 6.