Completing two functions to calculate the matrix inverse and to cache them