checking in the functions for caching matrix inveres