Added a simple memoization macro