memoization & currying