Solved problem 3