add solution for problem 16