Finish function cacheSolve