Completing problem 6