Completed problem 8