added problem 4 solution