Adding problem 12.
Changing cache to dict.