Test for memoize
Optimized @memoize a bit