edited problem 3