completed problem 6