added problem 5 solution