created the required functions

Created the functions that will calculate the inverse matrix if there
isn’t one in cache or load the one that is already in the cache.