solved problem 2.