added body of cacheSolve()