Created functions for caching matrix inverse