finish 'cacheSolve' function