Implemented inverse caching for programming assignment 2.