added cacheSolve() function