Updated makeCacheMatrix and cacheSolve function