add problem 6 solution
commented code