created 2 functions for caching matrix inverse