solved problem 3