Solved problem 6