Adding solution to problem 15