solved problem 6.