add function cacheSolve