Add solution to Problem 16