Created fucntion to cache matrix inverse