Modified makeCacheMatrix and cacheSolve to solve and cache the inverse of a matrix