Implemented functions

Initial implementation of caching functions.