added functions to cache matrix inverse