Adding solution to problem 20