Complete problem 6