corrected cacheSolve