create cacheSolve function