completed problem 8