functions that compute and cache the inverse of a matrix