Updated with functions to cache inverse of matrix