Testing memoization implementation in other functions