finished implementing functions to cache matrix inverse