add memorize decorator