trying out different memoization solutions