Added a cached version of problem 14