added problem 6 solution