Modified makeCacheMatrix and cacheSolve functions