Implemented the basics of the cache