Completed problem 6